Panel Interface Board  1
inszt_hvps.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:51:50 2020
5 */
6 /**************************************************************************************/
24 /**************************************************************************************/
25 /**************************************************************************************/
26 /* Section: Included Files */
27 /**************************************************************************************/
28 /**************************************************************************************/
29 #define QQQdialect MPLABX
30 #undef QQQ146
31 #undef QQQ148
32 #undef QQQbndchk
33 #undef QQQ294
34 #undef QQQEMBEDDEDICE
35  /* Note: for BITMAP execution histories QQQthreaded is not defined */
36 #undef QQQthreaded
37 #undef QQQdo178b
38 #undef QQQfixbra
39 #define QQQswitch3
40 #undef QQQternary
41 #define QQQswitch
42 #undef QQQmacrof
43 #undef QQQMULTIPROCESSEXH
44 #undef QQFLUSH
45 #undef QQNEWBS
46 #define qqqMaxBranchDepth 20
47 #define QQQstructbitmap
48  static int qqqqbmselwidth = 32 ;
49  static int zzfileid = 61;
50 #define QQQnumfil 23
51 #undef QQQALGONE
52 #undef QQQVCLFLG
53 #undef QQQFORKFL
54 #undef QQQIADDRF
55 #undef QQQRTI
56 #undef QQQPERFA
57 #undef QQQADRMOD
58 #undef QQQDCAPFL
59 #undef QQQTEMPLATEONLY
60 #define QQQNOATEXIT
61 #define QQQUPLOADATEND
62 #define QQQNOSTDIO
63 #undef QQQASHLINGVITRA
64 #define QQQBITMAP
65  #define qqqbitmapint unsigned int
66 #undef QQQBITMAPMCDC
67 #undef QQQTIC2XSERIALIO
68 #undef QQQTIC2XFLASH
69 #undef QQQCOMPRESSED_EXH
70 #undef QQQMAINFL
71 #define QQQSINGLEFILE
72 #define QQQFILEID
73 #define QQQseparate
74 extern int QQQindicator;
75 static int QQQfirstmcdc=1;
76 #define hvps_61zzopen zzopen
77  extern int hvps_61zzopen ;
78 #define hvps_61zqqzqz1 zqqzqz1
79 #define QQQLDRA_PORT
80 #ifndef QQQLDRA_PORT
81 #define FILEPOINT FILE * f,
82 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
83 #include <stdio.h>
84  /* ----------------------------------------------------------------------* 100 *
85  * If stdio.h is not available then insert:
86  * typedef int * FILE;
87  * -----------------------------------------------------------------------------
88  */
89 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
90 #else /* QQQLDRA_PORT */
91 #define FILEPOINT
92 /*************************** LDRA_PORT *********************************/
93 #ifdef QQQ_SHLAYOUT
94 static int tbrun_mode=1;
95 #else
96 static int tbrun_mode=0;
97 #endif /* QQQ_SHLAYOUT */
98 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
99 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
100 #ifndef QQQ_SHLAYOUT
101 #ifdef QQQMAINFL
102 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
104 #endif /* QQQMAINFL */
105 #endif /* QQQ_SHLAYOUT */
106 /************************ END OF LDRA_PORT *****************************/
107 #endif /* QQQLDRA_PORT */
108 #ifndef QQQnumfil
109 #define QQQnumfil 40 /* default setting */
110 #endif /* QQQnumfil */
111 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
112 #ifndef LDRA_VOID_FUNC
113 #define LDRA_VOID_FUNC
114  typedef void(*ldra_void_function)();
115 #endif
116 #if defined(QQQMAINFL)
117  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
118  through the target you would have to set this to 0 before calling the qqqupload.
119  Move this into ldra_port mechanism. */
120  int qqqshell_upload = 0;
121  int QQQfcn_ptr_num = 0;
122  static int qqqisinitialised = 0;
125  void qqqtotalupload(void);
126  void qqqtotalreset(void);
128  qqqaccumupload[x]=y;
129  qqqaccumreset[x]=z;
130  QQQfcn_ptr_num++;
131  }
132 #else /* (QQQMAINFL) */
133  extern int QQQfcn_ptr_num;
136  static int qqqstructzzopen = 0;
137 #endif /* defined(QQQMAINFL) */
138 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
139 #ifdef QQQ_KEEPCOMMENTS
140  /* -----------------------------------------------------------------------* 101 *
141  * Special settings for systems lacking standard functions.
142  * To include code for fprintf define ldra_fprintf
143  * To include code for sscanf define ldra_sscanf
144  * -----------------------------------------------------------------------------
145  */
146 #endif /* QQQ_KEEPCOMMENTS */
147 #if !defined(QQQSUPPRESS_UNDEF)
148 #undef ldra_fprintf
149 #undef ldra_sscanf
150 #endif /* !defined(QQQSUPPRESS_UNDEF) */
151  /* #define ldra_fprintf */
152  /* #define ldra_sscanf */
153 #undef QQQHITMAP_STORAGE
154 #undef qqnull_params
155 #define qqnull_params void
156 #define QQQ_PROTOTYPE_DEF
157  /* Conventional Instrumentation */
158 #undef QQ_ANSI_PROTOTYPE
159 #ifdef __STDC__
160 #define QQ_ANSI_PROTOTYPE 1
161 #else /* __STDC__ */
162 #ifdef VAXC
163 #define QQ_ANSI_PROTOTYPE 1
164 #endif /* VAXC */
165 #endif /* __STDC__ */
166  static unsigned char qqqzzglobflag = 0;
167  static struct bitmapstruct_t
168  {
169 #define ELEMENT(N) qqqbitmapint element##N;
170 #define LASTELEMENT
171 #include "hvps_61zbelem.def"
172 #undef ELEMENT
173 #undef LASTELEMENT
174  } bitmapstruct = {
175 #define ELEMENT(N) 0,
176 #undef LASTELEMENT
177 #include "hvps_61zbelem.def"
178 #undef ELEMENT
179  0};
180  static void qqoutput(FILEPOINT char * s,int i);
181  static void qqoutput2(FILEPOINT char * s,int i, int j);
182  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
183  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
184  static void qqoutput0(FILEPOINT char * s);
185  static int hvps_61zqqzqz(qqnull_params);
186  static int hvps_61zqqzqz1(qqnull_params);
187  static int hvps_61zqendz (int qqqi);
188  static int hvps_61zqzqzq (int qqqi);
189  static void qqqupload(qqnull_params);
190  static void qqqbitmapreset(qqnull_params);
191 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
192 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h */
193 //**************************************************************************************/
207 /**************************************************************************************/
208 #ifndef HVPS_H /* Guard against multiple inclusion.*/
209 #define HVPS_H
210 /**************************************************************************************/
211 /**************************************************************************************/
212 /* Section: Included Files */
213 /**************************************************************************************/
214 /**************************************************************************************/
215 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
216 /*******************************************************************************
217  System Definitions
218  File Name:
219  system_definitions.h
220  Summary:
221  MPLAB Harmony project system definitions.
222  Description:
223  This file contains the system-wide prototypes and definitions for an MPLAB
224  Harmony project.
225  *******************************************************************************/
226 //DOM-IGNORE-BEGIN
227 /*******************************************************************************
228 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
229 Microchip licenses to you the right to use, modify, copy and distribute
230 Software only when embedded on a Microchip microcontroller or digital signal
231 controller that is integrated into your product or third party product
232 (pursuant to the sublicense terms in the accompanying license agreement).
233 You should refer to the license agreement accompanying this Software for
234 additional information regarding your rights and obligations.
235 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
236 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
237 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
238 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
239 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
240 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
241 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
242 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
243 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
244 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
245  *******************************************************************************/
246 //DOM-IGNORE-END
247 #ifndef _SYS_DEFINITIONS_H
248 #define _SYS_DEFINITIONS_H
249 // *****************************************************************************
250 // *****************************************************************************
251 // Section: Included Files
252 // *****************************************************************************
253 // *****************************************************************************
254 #include <stdint.h>
255 #include <stddef.h>
256 #include <stdbool.h>
257 #include "system/common/sys_common.h"
258 #include "system/common/sys_module.h"
259 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
260 /*******************************************************************************
261  Input Capture Driver Interface Declarations for Static Single Instance Driver
262  Company:
263  Microchip Technology Inc.
264  File Name:
265  help_drv_ic.h
266  Summary:
267  Input Capture driver interface declarations for the static single instance
268  driver.
269  Description:
270  The Input Capture device driver provides a simple interface to manage the
271  Input Capture modules on Microchip microcontrollers. This file defines
272  the interface declarations for the IC driver.
273 
274  Remarks:
275  Static interfaces incorporate the driver instance number within the names
276  of the routines, eliminating the need for an object ID or object handle.
277 
278  Static single-open interfaces also eliminate the need for the open handle.
279 *******************************************************************************/
280 //DOM-IGNORE-BEGIN
281 /*******************************************************************************
282 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
283 Microchip licenses to you the right to use, modify, copy and distribute
284 Software only when embedded on a Microchip microcontroller or digital signal
285 controller that is integrated into your product or third party product
286 (pursuant to the sublicense terms in the accompanying license agreement).
287 You should refer to the license agreement accompanying this Software for
288 additional information regarding your rights and obligations.
289 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
290 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
291 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
292 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
293 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
294 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
295 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
296 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
297 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
298 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
299 *******************************************************************************/
300 //DOM-IGNORE-END
301 #ifndef _DRV_IC_H
302 #define _DRV_IC_H
303 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
304 /*******************************************************************************
305  MPLAB Harmony System Configuration Header
306  File Name:
307  system_config.h
308  Summary:
309  Build-time configuration header for the system defined by this MPLAB Harmony
310  project.
311  Description:
312  An MPLAB Project may have multiple configurations. This file defines the
313  build-time options for a single configuration.
314  Remarks:
315  This configuration header must not define any prototypes or data
316  definitions (or include any files that do). It only provides macro
317  definitions for build-time configuration options that are not instantiated
318  until used by another MPLAB Harmony module or application.
319  Created with MPLAB Harmony Version 2.06
320 *******************************************************************************/
321 // DOM-IGNORE-BEGIN
322 /*******************************************************************************
323 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
324 Microchip licenses to you the right to use, modify, copy and distribute
325 Software only when embedded on a Microchip microcontroller or digital signal
326 controller that is integrated into your product or third party product
327 (pursuant to the sublicense terms in the accompanying license agreement).
328 You should refer to the license agreement accompanying this Software for
329 additional information regarding your rights and obligations.
330 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
331 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
332 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
333 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
334 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
335 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
336 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
337 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
338 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
339 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
340 *******************************************************************************/
341 // DOM-IGNORE-END
342 #ifndef _SYSTEM_CONFIG_H
343 #define _SYSTEM_CONFIG_H
344 // *****************************************************************************
345 // *****************************************************************************
346 // Section: Included Files
347 // *****************************************************************************
348 // *****************************************************************************
349 /* This section Includes other configuration headers necessary to completely
350  define this configuration.
351 */
352 // DOM-IGNORE-BEGIN
353 // DOM-IGNORE-END
354 // *****************************************************************************
355 // *****************************************************************************
356 // Section: System Service Configuration
357 // *****************************************************************************
358 // *****************************************************************************
359 // *****************************************************************************
360 /* Common System Service Configuration Options
361 */
362 #define SYS_VERSION_STR "2.06"
363 #define SYS_VERSION 20600
364 // *****************************************************************************
365 /* Clock System Service Configuration Options
366 */
367 #define SYS_CLK_FREQ 200000000ul
368 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
369 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
370 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
371 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
372 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
373 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
374 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
375 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
376 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
377 /*** Ports System Service Configuration ***/
378 #define SYS_PORT_A_ANSEL 0x3F00
379 #define SYS_PORT_A_TRIS 0xFFED
380 #define SYS_PORT_A_LAT 0x0010
381 #define SYS_PORT_A_ODC 0x0000
382 #define SYS_PORT_A_CNPU 0x0020
383 #define SYS_PORT_A_CNPD 0x0000
384 #define SYS_PORT_A_CNEN 0x0021
385 #define SYS_PORT_B_ANSEL 0x10C8
386 #define SYS_PORT_B_TRIS 0x91FF
387 #define SYS_PORT_B_LAT 0x0000
388 #define SYS_PORT_B_ODC 0x0000
389 #define SYS_PORT_B_CNPU 0x0000
390 #define SYS_PORT_B_CNPD 0x0000
391 #define SYS_PORT_B_CNEN 0x0000
392 #define SYS_PORT_C_ANSEL 0xCFE1
393 #define SYS_PORT_C_TRIS 0xFFFF
394 #define SYS_PORT_C_LAT 0x0000
395 #define SYS_PORT_C_ODC 0x0000
396 #define SYS_PORT_C_CNPU 0x0000
397 #define SYS_PORT_C_CNPD 0x0000
398 #define SYS_PORT_C_CNEN 0x0000
399 #define SYS_PORT_D_ANSEL 0xC100
400 #define SYS_PORT_D_TRIS 0xFFFF
401 #define SYS_PORT_D_LAT 0x0000
402 #define SYS_PORT_D_ODC 0x0000
403 #define SYS_PORT_D_CNPU 0x0000
404 #define SYS_PORT_D_CNPD 0x0000
405 #define SYS_PORT_D_CNEN 0x0000
406 #define SYS_PORT_E_ANSEL 0xFC00
407 #define SYS_PORT_E_TRIS 0xFDFF
408 #define SYS_PORT_E_LAT 0x0000
409 #define SYS_PORT_E_ODC 0x0000
410 #define SYS_PORT_E_CNPU 0x0000
411 #define SYS_PORT_E_CNPD 0x0000
412 #define SYS_PORT_E_CNEN 0x0000
413 #define SYS_PORT_F_ANSEL 0xCEC0
414 #define SYS_PORT_F_TRIS 0xEFFF
415 #define SYS_PORT_F_LAT 0x0000
416 #define SYS_PORT_F_ODC 0x0000
417 #define SYS_PORT_F_CNPU 0x0000
418 #define SYS_PORT_F_CNPD 0x0000
419 #define SYS_PORT_F_CNEN 0x0000
420 #define SYS_PORT_G_ANSEL 0x8CBC
421 #define SYS_PORT_G_TRIS 0xDFFF
422 #define SYS_PORT_G_LAT 0x0000
423 #define SYS_PORT_G_ODC 0x0000
424 #define SYS_PORT_G_CNPU 0x0000
425 #define SYS_PORT_G_CNPD 0x0000
426 #define SYS_PORT_G_CNEN 0x0000
427 #define SYS_PORT_H_ANSEL 0x0070
428 #define SYS_PORT_H_TRIS 0xB3FB
429 #define SYS_PORT_H_LAT 0x0000
430 #define SYS_PORT_H_ODC 0x0000
431 #define SYS_PORT_H_CNPU 0x0000
432 #define SYS_PORT_H_CNPD 0x0000
433 #define SYS_PORT_H_CNEN 0x0000
434 #define SYS_PORT_J_ANSEL 0x0000
435 #define SYS_PORT_J_TRIS 0x8B7F
436 #define SYS_PORT_J_LAT 0x0080
437 #define SYS_PORT_J_ODC 0x0000
438 #define SYS_PORT_J_CNPU 0x0000
439 #define SYS_PORT_J_CNPD 0x0000
440 #define SYS_PORT_J_CNEN 0x0800
441 #define SYS_PORT_K_ANSEL 0xFF00
442 #define SYS_PORT_K_TRIS 0xFFFF
443 #define SYS_PORT_K_LAT 0x0000
444 #define SYS_PORT_K_ODC 0x0000
445 #define SYS_PORT_K_CNPU 0x0000
446 #define SYS_PORT_K_CNPD 0x0000
447 #define SYS_PORT_K_CNEN 0x0000
448 /*** Interrupt System Service Configuration ***/
449 #define SYS_INT true
450 /*** Timer System Service Configuration ***/
451 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
452 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
453 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
454 #define SYS_TMR_FREQUENCY 1000
455 #define SYS_TMR_FREQUENCY_TOLERANCE 10
456 #define SYS_TMR_UNIT_RESOLUTION 10000
457 #define SYS_TMR_CLIENT_TOLERANCE 10
458 #define SYS_TMR_INTERRUPT_NOTIFICATION false
459 // *****************************************************************************
460 // *****************************************************************************
461 // Section: Driver Configuration
462 // *****************************************************************************
463 // *****************************************************************************
464 #define DRV_IC_DRIVER_MODE_STATIC
465 #define USE_8BIT_PMP
466 /*** SPI Driver Configuration ***/
467 #define DRV_SPI_NUMBER_OF_MODULES 6
468 /*** Driver Compilation and static configuration options. ***/
469 /*** Select SPI compilation units.***/
470 #define DRV_SPI_POLLED 1
471 #define DRV_SPI_ISR 0
472 #define DRV_SPI_MASTER 1
473 #define DRV_SPI_SLAVE 0
474 #define DRV_SPI_RM 0
475 #define DRV_SPI_EBM 1
476 #define DRV_SPI_8BIT 1
477 #define DRV_SPI_16BIT 1
478 #define DRV_SPI_32BIT 0
479 #define DRV_SPI_DMA 0
480 /*** SPI Driver Static Allocation Options ***/
481 #define DRV_SPI_INSTANCES_NUMBER 3
482 #define DRV_SPI_CLIENTS_NUMBER 3
483 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
484 /* SPI Driver Instance 0 Configuration */
485 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
486 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
487 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
488 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
489 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
490 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
491 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
492 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
493 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
494 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
495 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
496 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
497 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
498 #define DRV_SPI_BAUD_RATE_IDX0 1000000
499 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
500 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
501 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
502 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
503 #define DRV_SPI_QUEUE_SIZE_IDX0 10
504 #define DRV_SPI_RESERVED_JOB_IDX0 1
505 /* SPI Driver Instance 1 Configuration */
506 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
507 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
508 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
509 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
510 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
511 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
512 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
513 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
514 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
515 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
516 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
517 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
518 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
519 #define DRV_SPI_BAUD_RATE_IDX1 1000000
520 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
521 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
522 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
523 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
524 #define DRV_SPI_QUEUE_SIZE_IDX1 10
525 #define DRV_SPI_RESERVED_JOB_IDX1 1
526 /* SPI Driver Instance 2 Configuration */
527 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
528 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
529 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
530 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
531 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
532 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
533 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
534 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
535 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
536 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
537 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
538 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
539 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
540 #define DRV_SPI_BAUD_RATE_IDX2 500000
541 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
542 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
543 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
544 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
545 #define DRV_SPI_QUEUE_SIZE_IDX2 10
546 #define DRV_SPI_RESERVED_JOB_IDX2 1
547 /*** Timer Driver Configuration ***/
548 #define DRV_TMR_INTERRUPT_MODE true
549 /*** Timer Driver 0 Configuration ***/
550 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
551 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
552 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
553 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
554 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
555 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
556 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
557 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
558 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
559 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
560 #define DRV_TMR_POWER_STATE_IDX0
561 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
562 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
563 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
564 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
565 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
566 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
567 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
568 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
569 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
570 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
571 #define DRV_TMR_POWER_STATE_IDX1
572 /*** Timer Driver 2 Configuration ***/
573 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
574 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
575 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
576 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
577 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
578 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
579 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
580 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
581 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
582 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
583 #define DRV_TMR_POWER_STATE_IDX2
584 /*** Timer Driver 3 Configuration ***/
585 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
586 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
587 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
588 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
589 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
590 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
591 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
592 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
593 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
594 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
595 #define DRV_TMR_POWER_STATE_IDX3
596 /*** Timer Driver 4 Configuration ***/
597 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
598 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
599 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
600 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
601 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
602 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
603 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
604 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
605 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
606 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
607 #define DRV_TMR_POWER_STATE_IDX4
608  // *****************************************************************************
609 /* USART Driver Configuration Options
610 */
611 #define DRV_USART_INSTANCES_NUMBER 1
612 #define DRV_USART_CLIENTS_NUMBER 1
613 #define DRV_USART_INTERRUPT_MODE false
614 #define DRV_USART_BYTE_MODEL_SUPPORT true
615 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
616 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
617 // *****************************************************************************
618 // *****************************************************************************
619 // Section: Middleware & Other Library Configuration
620 // *****************************************************************************
621 // *****************************************************************************
622 /*** USB Driver Configuration ***/
623 /* Enables Device Support */
624 #define DRV_USBHS_DEVICE_SUPPORT true
625 /* Disable Host Support */
626 #define DRV_USBHS_HOST_SUPPORT false
627 /* Maximum USB driver instances */
628 #define DRV_USBHS_INSTANCES_NUMBER 1
629 /* Interrupt mode enabled */
630 #define DRV_USBHS_INTERRUPT_MODE true
631 /* Number of Endpoints used */
632 #define DRV_USBHS_ENDPOINTS_NUMBER 2
633 /*** USB Device Stack Configuration ***/
634 /* The USB Device Layer will not initialize the USB Driver */
635 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
636 /* Maximum device layer instances */
637 #define USB_DEVICE_INSTANCES_NUMBER 1
638 /* EP0 size in bytes */
639 #define USB_DEVICE_EP0_BUFFER_SIZE 64
640 /* Endpoint Transfer Queue Size combined for Read and write */
641 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
642 // *****************************************************************************
643 // *****************************************************************************
644 // Section: Application Configuration
645 // *****************************************************************************
646 // *****************************************************************************
647 /*** Application Defined Pins ***/
648 /*** Functions for LED1 pin ***/
649 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
650 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
651 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
652 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
653 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
654 /*** Functions for LED2 pin ***/
655 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
656 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
657 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
658 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
659 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
660 /*** Functions for DMP_FIRE_LED pin ***/
661 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
662 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
663 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
664 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
665 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
666 /*** Functions for HVPS_ENB pin ***/
667 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
668 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
669 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
670 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
671 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
672 /*** Functions for RLY_HVPS_OUT pin ***/
673 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
674 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
675 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
676 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
677 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
678 /*** Functions for RLY_WL_SPS_POL pin ***/
679 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
680 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
681 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
682 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
683 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
684 /*** Functions for RLY_LOG pin ***/
685 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
686 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
687 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
688 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
689 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
690 /*** Functions for RLY_DMP_FIRE pin ***/
691 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
692 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
693 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
694 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
695 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
696 /*** Functions for RLY_AUX pin ***/
697 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
698 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
699 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
700 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
701 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
702 /*** Functions for RLY_CCL pin ***/
703 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
704 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
705 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
706 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
707 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
708 /*** Functions for RLY_WL_MON pin ***/
709 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
710 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
711 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
712 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
713 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
714 /*** Functions for RLY_ARMCF pin ***/
715 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
716 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
717 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
718 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
719 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
720 /*** Functions for RLY_ARM pin ***/
721 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
722 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
723 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
724 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
725 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
726 /*** Functions for TPAN1 pin ***/
727 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
728 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
729 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
730 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
731 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
732 /*** Functions for TPAN2 pin ***/
733 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
734 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
735 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
736 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
737 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
738 /*** Functions for FSK_DAC_CS pin ***/
739 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
740 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
741 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
742 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
743 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
744 /*** Functions for RLY_COMM pin ***/
745 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
746 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
747 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
748 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
749 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
750 /*** Functions for FSK_DAC_CLR pin ***/
751 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
752 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
753 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
754 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
755 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
756 /*** Functions for WL_CPS_SW pin ***/
757 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
758 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
759 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
760 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
761 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
762 /*** Functions for HVPS_SW pin ***/
763 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
764 /*** Functions for MAN_SIG pin ***/
765 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
766 /*** Functions for DMP_FIRE_SW pin ***/
767 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
768 /*** Functions for NEG_SW pin ***/
769 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
770 /*** Functions for POS_SW pin ***/
771 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
772 /*** Functions for DRUM1_SW pin ***/
773 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
774 /*** Functions for SAFE_SW pin ***/
775 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
776 /*** Functions for DRUM2_SW pin ***/
777 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
778 /*** Functions for LOG_SW pin ***/
779 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
780 /*** Functions for AUX_SW pin ***/
781 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
782 /*** Functions for ARMCF_SW pin ***/
783 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
784 /*** Functions for ARM_SW pin ***/
785 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
786 /*** Functions for ARMCF_AUTO_SW pin ***/
787 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
788 /*** Functions for FIRE_SW_OFF pin ***/
789 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
790 /*** Functions for FIRE_SW_ON pin ***/
791 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
792 /*** Functions for WL_SPS_POS_DET pin ***/
793 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
794 /*** Functions for WL_SPS_NEG_DET pin ***/
795 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
796 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
797 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
798 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
799 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
800 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
801 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
802 /*** Application Instance 0 Configuration ***/
803 //DOM-IGNORE-BEGIN
804 //DOM-IGNORE-END
805  // _SYSTEM_CONFIG_H
806 /*******************************************************************************
807  End of File
808 */
809 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
810 /* CLOSE_FILE Include File */
811 
812 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
813 /*******************************************************************************
814  Driver Common Header Definitions
815  Company:
816  Microchip Technology Inc.
817  File Name:
818  drv_common.h
819  Summary:
820  This file defines the common macros and definitions used by the driver
821  definition and implementation headers.
822  Description:
823  This file defines the common macros and definitions used by the driver
824  definition and the implementation header.
825  Remarks:
826  The directory in which this file resides should be added to the compiler's
827  search path for header files.
828  *******************************************************************************/
829 //DOM-IGNORE-BEGIN
830 /*******************************************************************************
831 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
832 Microchip licenses to you the right to use, modify, copy and distribute
833 Software only when embedded on a Microchip microcontroller or digital signal
834 controller that is integrated into your product or third party product
835 (pursuant to the sublicense terms in the accompanying license agreement).
836 You should refer to the license agreement accompanying this Software for
837 additional information regarding your rights and obligations.
838 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
839 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
840 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
841 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
842 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
843 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
844 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
845 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
846 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
847 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
848  *******************************************************************************/
849 //DOM-IGNORE-END
850 #ifndef _DRV_COMMON_H
851 #define _DRV_COMMON_H
852 #include <stdint.h>
853 #include <stddef.h>
854 // *****************************************************************************
855 /* Device Driver I/O Intent
856  Summary:
857  Identifies the intended usage of the device when it is opened.
858  Description:
859  This enumeration identifies the intended usage of the device when the
860  caller opens the device. It identifies the desired behavior of the device
861  driver for the following:
862  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
863  block until the operation is finished or do they return immediately and
864  require the caller to call another routine to check the status of the
865  operation)
866  * Support reading and/or writing of data from/to the device
867  * Identify the buffering behavior (sometimes called "double buffering" of
868  the driver. Indicates if the driver should maintain its own read/write
869  buffers and copy data to/from these buffers to/from the caller's buffers.
870  * Identify the DMA behavior of the peripheral
871  Remarks:
872  The buffer allocation method is not identified by this enumeration. Buffers
873  can be allocated statically at build time, dynamically at run-time, or
874  even allocated by the caller and passed to the driver for its own usage if
875  a driver-specific routine is provided for such. This choice is left to
876  the design of the individual driver and is considered part of its
877  interface.
878  These values can be considered "flags". One selection from each of the
879  groups below can be ORed together to create the complete value passed
880  to the driver's open routine.
881 */
882 
883 typedef
884  enum
885  {
886  /* Read */
887  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
888  = 1 << 0 /* DOM-IGNORE-END*/
889  ,
890  /* Write */
891  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
892  = 1 << 1 /* DOM-IGNORE-END*/
893  ,
894  /* Read and Write*/
895  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
896  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
897  ,
898  /* The driver will block and will return when the operation is complete */
899  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
900  = 0 << 2 /* DOM-IGNORE-END*/
901  ,
902  /* The driver will return immediately */
903  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
904  = 1 << 2 /* DOM-IGNORE-END*/
905  ,
906  /* The driver will support only one client at a time */
907  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
908  = 1 << 3 /* DOM-IGNORE-END*/
909  ,
910  /* The driver will support multiple clients at a time */
911  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
912  = 0 << 3 /* DOM-IGNORE-END*/
913  } DRV_IO_INTENT ;
914 // *****************************************************************************
915 /* Driver Client Status
916  Summary:
917  Identifies the current status/state of a client's connection to a driver.
918  Description:
919  This enumeration identifies the current status/state of a client's link to
920  a driver.
921  Remarks:
922  The enumeration used as the return type for the client-level status routines
923  defined by each device driver or system module (for example,
924  DRV_USART_ClientStatus) must be based on the values in this enumeration.
925 */
926 
927 typedef
928  enum
929  {
930  /* Indicates that a driver-specific error has occurred. */
932  /* An unspecified error has occurred.*/
934  /* The driver is closed, no operations for this client are ongoing,
935  and/or the given handle is invalid. */
937  /* The driver is currently busy and cannot start additional operations. */
939  /* The module is running and ready for additional operations */
941  /* Indicates that the module is in a driver-specific ready/run state. */
944 // *****************************************************************************
945 /* Device Driver Blocking Status Macro
946  Summary:
947  Returns if the I/O intent provided is blocking
948  Description:
949  This macro returns if the I/O intent provided is blocking.
950  Remarks:
951  None.
952 */
953 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
954 // *****************************************************************************
955 /* Device Driver Non Blocking Status Macro
956  Summary:
957  Returns if the I/O intent provided is non-blocking.
958  Description:
959  This macro returns if the I/ intent provided is non-blocking.
960  Remarks:
961  None.
962 */
963 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
964 // *****************************************************************************
965 /* Device Driver Exclusive Status Macro
966  Summary:
967  Returns if the I/O intent provided is non-blocking.
968  Description:
969  This macro returns if the I/O intent provided is non-blocking.
970  Remarks:
971  None.
972 */
973 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
974 // *****************************************************************************
975 /* Device Driver IO Buffer Identifier
976  Summary:
977  Identifies to which buffer a device operation will apply.
978  Description:
979  This enumeration identifies to which buffer (read, write, both, or neither)
980  a device operation will apply. This is used for "flush" (or similar)
981  operations.
982 */
983 
984 typedef
985  enum
986  {
987  // Operation does not apply to any buffer
989  // Operation applies to read buffer
991  // Operation applies to write buffer
993  // Operation applies to both read and write buffers
996 // *****************************************************************************
997 /* Device Handle
998  Summary:
999  Handle to an opened device driver.
1000  Description:
1001  This handle identifies the open instance of a device driver. It must be
1002  passed to all other driver routines (except the initialization, deinitialization,
1003  or power routines) to identify the caller.
1004  Remarks:
1005  Every application or module that wants to use a driver must first call
1006  the driver's open routine. This is the only routine that is absolutely
1007  required for every driver.
1008  If a driver is unable to allow an additional module to use it, it must then
1009  return the special value DRV_HANDLE_INVALID. Callers should check the
1010  handle returned for this value to ensure this value was not returned before
1011  attempting to call any other driver routines using the handle.
1012 */
1013 
1014 typedef
1015 uintptr_t
1017 // *****************************************************************************
1018 /* Invalid Device Handle
1019  Summary:
1020  Invalid device handle.
1021  Description:
1022  If a driver is unable to allow an additional module to use it, it must then
1023  return the special value DRV_HANDLE_INVALID. Callers should check the
1024  handle returned for this value to ensure this value was not returned before
1025  attempting to call any other driver routines using the handle.
1026  Remarks:
1027  None.
1028 */
1029 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1030 // *****************************************************************************
1031 /* Not supported configuration
1032  Summary:
1033  Not supported configuration.
1034  Description:
1035  If the configuration option is not supported on an instance of the
1036  peripheral, use this macro to equate to that configuration. This option
1037  should be listed as a possible value in the description of that
1038  configuration option.
1039 */
1040 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1041 // *****************************************************************************
1042 /* Unsupported Attribute Abstraction
1043  Summary:
1044  Abstracts the use of the unsupported attribute defined by the compiler.
1045  Description:
1046  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1047  compilation of the drivers for all different variants.
1048  Example:
1049  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1050  This function will not generate a compiler error if the interface is not
1051  defined for the selected device.
1052  Remarks:
1053  None.
1054 */
1055 #define _PLIB_UNSUPPORTED
1056  //_DRV_COMMON_H
1057 /*******************************************************************************
1058  End of File
1059 */
1060 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1061 /* CLOSE_FILE Include File */
1062 
1063 #include "system/common/sys_module.h"
1064 // *****************************************************************************
1065 /* IC Driver Module Index Numbers
1066  Summary:
1067  IC driver index definitions.
1068  Description:
1069  These constants provide IC Driver index definitions.
1070  Remarks:
1071  These constants should be used in place of hard-coded numeric literals.
1072  These values should be passed into the DRV_IC_Initialize and
1073  DRV_IC_Open routines to identify the driver instance in use.
1074 */
1075 #define DRV_IC_INDEX_0 0
1076 #define DRV_IC_INDEX_1 1
1077 #define DRV_IC_INDEX_2 2
1078 #define DRV_IC_INDEX_3 3
1079 #define DRV_IC_INDEX_4 4
1080 #define DRV_IC_INDEX_5 5
1081 #define DRV_IC_INDEX_6 6
1082 #define DRV_IC_INDEX_7 7
1083 #define DRV_IC_INDEX_8 8
1084 #define DRV_IC_INDEX_9 9
1085 #define DRV_IC_INDEX_10 10
1086 #define DRV_IC_INDEX_11 11
1087 #define DRV_IC_INDEX_12 12
1088 #define DRV_IC_INDEX_13 13
1089 #define DRV_IC_INDEX_14 14
1090 #define DRV_IC_INDEX_15 15
1091 // *****************************************************************************
1092 // *****************************************************************************
1093 // Section: Interface Headers for the static driver
1094 // *****************************************************************************
1095 // *****************************************************************************
1096 // *****************************************************************************
1097 /* Function:
1098  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1099  const SYS_MODULE_INIT * const init);
1100  Summary:
1101  Initializes the Input Capture instance for the specified driver index.
1102  <p><b>Implementation:</b> Static</p>
1103  Description:
1104  This routine initializes the Input Capture driver instance for the specified
1105  driver instance, making it ready for clients to use it. The initialization
1106  routine is specified by the MHC parameters. The driver instance index is
1107  independent of the Input Capture module ID. For example, driver instance 0
1108  can be assigned to Input Capture 2.
1109  Precondition:
1110  None.
1111  Parameters:
1112  None.
1113  Returns:
1114  None.
1115  Remarks:
1116  This routine must be called before any other Input Capture routine is called.
1117  This routine should only be called once during system initialization.
1118 */
1119 
1120 SYS_MODULE_OBJ
1122  const SYS_MODULE_INDEX index ,
1123  const SYS_MODULE_INIT * const init ) ;
1124 // *****************************************************************************
1125 /* Function:
1126 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1127  Summary:
1128  Opens the Input Capture instance for the specified driver index.
1129  <p><b>Implementation:</b> Static</p>
1130  Description:
1131  This routine starts the Input Capture driver for the specified driver
1132  index, starting an input capture.
1133  Precondition:
1134  DRV_IC_Initialize has been called.
1135  Parameters:
1136  None.
1137  Returns:
1138  None.
1139  Remarks:
1140  None.
1141 */
1142 
1143 DRV_HANDLE
1144  DRV_IC_Open (
1145  const SYS_MODULE_INDEX drvIndex ,
1146  const DRV_IO_INTENT intent ) ;
1147 // *****************************************************************************
1148 /* Function:
1149  void DRV_IC_Close(DRV_HANDLE handle)
1150  Summary:
1151  Closes the Input Capture instance for the specified driver index.
1152  <p><b>Implementation:</b> Static</p>
1153  Description:
1154  This routine stops the Input Capture driver for the specified driver
1155  index, stopping an input capture.
1156  Precondition:
1157  DRV_IC_Initialize has been called.
1158  Parameters:
1159  None.
1160  Returns:
1161  None.
1162  Remarks:
1163  None.
1164 */
1165 
1166 void
1167  DRV_IC_Close (
1168  DRV_HANDLE handle ) ;
1169 // *****************************************************************************
1170 /* Function:
1171 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1172  Summary:
1173  Starts the Input Capture instance for the specified driver index.
1174  <p><b>Implementation:</b> Static</p>
1175  Description:
1176  This routine starts the Input Capture driver for the specified driver
1177  index, starting an input capture.
1178  Precondition:
1179  DRV_IC_Initialize has been called.
1180  Parameters:
1181  None.
1182  Returns:
1183  None.
1184  Remarks:
1185  None.
1186 */
1187 
1188 DRV_HANDLE
1189  DRV_IC_Start (
1190  const SYS_MODULE_INDEX drvIndex ,
1191  const DRV_IO_INTENT intent ) ;
1192 // *****************************************************************************
1193 /* Function:
1194  void DRV_IC_Stop(DRV_HANDLE handle)
1195  Summary:
1196  Stops the Input Capture instance for the specified driver index.
1197  <p><b>Implementation:</b> Static</p>
1198  Description:
1199  This routine stops the Input Capture driver for the specified driver
1200  index, stopping an input capture.
1201  Precondition:
1202  DRV_IC_Initialize has been called.
1203  Parameters:
1204  None.
1205  Returns:
1206  None.
1207  Remarks:
1208  None.
1209 */
1210 
1211 void
1212  DRV_IC_Stop (
1213  DRV_HANDLE handle ) ;
1214 // *****************************************************************************
1215 /* Function:
1216  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1217  Summary:
1218  Reads the 32-bit Input Capture for the specified driver index.
1219  <p><b>Implementation:</b> Static</p>
1220  Description:
1221  This routine reads the 32-bit data for the specified driver index
1222  Precondition:
1223  DRV_IC_Initialize has been called.
1224  Parameters:
1225  None.
1226  Returns:
1227  uint32_t value of the data read from the Input Capture.
1228  Remarks:
1229  None.
1230 */
1231 
1232 uint32_t
1234  DRV_HANDLE handle ) ;
1235 // *****************************************************************************
1236 /* Function:
1237  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1238  Summary:
1239  Reads the 16-bit Input Capture for the specified driver index.
1240  <p><b>Implementation:</b> Static</p>
1241  Description:
1242  This routine reads the 16-bit data for the specified driver index.
1243  Precondition:
1244  DRV_IC_Initialize has been called.
1245  Parameters:
1246  None.
1247  Returns:
1248  uint16_t value of the data read from the Input Capture.
1249  Remarks:
1250  None.
1251 */
1252 
1253 uint16_t
1255  DRV_HANDLE handle ) ;
1256 // *****************************************************************************
1257 /* Function:
1258  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1259  Summary:
1260  Returns the Input Capture instance buffer empty status for the specified driver
1261  index.
1262  <p><b>Implementation:</b> Static</p>
1263  Description:
1264  Returns the Input Capture instance buffer empty status for the specified driver
1265  index. The function should be called to determine whether or not the IC buffer
1266  has data.
1267  Precondition:
1268  DRV_IC_Initialize has been called.
1269  Parameters:
1270  None.
1271  Returns:
1272  Boolean
1273  - 1 - Buffer is empty
1274  - 0 - Buffer is not empty
1275  Remarks:
1276  None.
1277 */
1278 
1279 bool
1281  DRV_HANDLE handle ) ;
1282 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1283 /*******************************************************************************
1284  IC Driver Interface Declarations for Static Single Instance Driver
1285  Company:
1286  Microchip Technology Inc.
1287  File Name:
1288  drv_ic_static.h
1289  Summary:
1290  IC driver interface declarations for the static single instance driver.
1291  Description:
1292  The IC device driver provides a simple interface to manage the IC
1293  modules on Microchip microcontrollers. This file defines the interface
1294  Declarations for the IC driver.
1295 
1296  Remarks:
1297  Static interfaces incorporate the driver instance number within the names
1298  of the routines, eliminating the need for an object ID or object handle.
1299 
1300  Static single-open interfaces also eliminate the need for the open handle.
1301 *******************************************************************************/
1302 //DOM-IGNORE-BEGIN
1303 /*******************************************************************************
1304 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1305 Microchip licenses to you the right to use, modify, copy and distribute
1306 Software only when embedded on a Microchip microcontroller or digital signal
1307 controller that is integrated into your product or third party product
1308 (pursuant to the sublicense terms in the accompanying license agreement).
1309 You should refer to the license agreement accompanying this Software for
1310 additional information regarding your rights and obligations.
1311 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1312 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1313 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1314 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1315 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1316 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1317 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1318 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1319 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1320 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1321 *******************************************************************************/
1322 //DOM-IGNORE-END
1323 #ifndef _DRV_IC_STATIC_H
1324 #define _DRV_IC_STATIC_H
1325 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1326 #define DRV_IC_Close( handle )
1327 // *****************************************************************************
1328 // *****************************************************************************
1329 // Section: Interface Headers for Instance 0 for the static driver
1330 // *****************************************************************************
1331 // *****************************************************************************
1332 
1333 void
1334  DRV_IC0_Initialize ( void ) ;
1335 
1336 void
1337  DRV_IC0_Start ( void ) ;
1338 
1339 void
1340  DRV_IC0_Stop ( void ) ;
1341 
1342 uint32_t
1343  DRV_IC0_Capture32BitDataRead ( void ) ;
1344 
1345 uint16_t
1346  DRV_IC0_Capture16BitDataRead ( void ) ;
1347 
1348 bool
1349  DRV_IC0_BufferIsEmpty ( void ) ;
1350  // #ifndef _DRV_IC_STATIC_H
1351 /*******************************************************************************
1352  End of File
1353 */
1354 
1355 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1356 /* CLOSE_FILE Include File */
1357 
1358  // #ifndef _DRV_IC_H
1359 /*******************************************************************************
1360  End of File
1361 */
1362 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1363 /* CLOSE_FILE Include File */
1364 
1365 #include "system/devcon/sys_devcon.h"
1366 #include "system/clk/sys_clk.h"
1367 #include "system/int/sys_int.h"
1368 #include "system/tmr/sys_tmr.h"
1369 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1370 /*******************************************************************************
1371  ADC Driver Interface Declarations for Static Single Instance Driver
1372  Company:
1373  Microchip Technology Inc.
1374  File Name:
1375  drv_adc_static.h
1376  Summary:
1377  ADC driver interface declarations for the static single instance driver.
1378  Description:
1379  The ADC device driver provides a simple interface to manage the ADC
1380  modules on Microchip microcontrollers. This file defines the interface
1381  Declarations for the ADC driver.
1382 
1383  Remarks:
1384  Static interfaces incorporate the driver instance number within the names
1385  of the routines, eliminating the need for an object ID or object handle.
1386 
1387  Static single-open interfaces also eliminate the need for the open handle.
1388 *******************************************************************************/
1389 //DOM-IGNORE-BEGIN
1390 /*******************************************************************************
1391 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1392 Microchip licenses to you the right to use, modify, copy and distribute
1393 Software only when embedded on a Microchip microcontroller or digital signal
1394 controller that is integrated into your product or third party product
1395 (pursuant to the sublicense terms in the accompanying license agreement).
1396 You should refer to the license agreement accompanying this Software for
1397 additional information regarding your rights and obligations.
1398 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1399 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1400 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1401 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1402 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1403 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1404 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1405 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1406 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1407 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1408 *******************************************************************************/
1409 //DOM-IGNORE-END
1410 #ifndef _DRV_ADC_STATIC_H
1411 #define _DRV_ADC_STATIC_H
1412 #include <stdbool.h>
1413 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1414 #include "peripheral/adchs/plib_adchs.h"
1415 #include "peripheral/int/plib_int.h"
1416 
1417 typedef
1418  enum
1419  {
1420  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1422  } DRV_ADC_MODULE_ID ;
1423 // *****************************************************************************
1424 // *****************************************************************************
1425 // Section: Interface Headers for ADC Static Driver
1426 // *****************************************************************************
1427 // *****************************************************************************
1428 
1429 void
1430  DRV_ADC_Initialize ( void ) ;
1431 
1432 inline void
1433  DRV_ADC_DeInitialize ( void ) ;
1434 
1435 inline void
1436  DRV_ADC0_Open ( void ) ;
1437 
1438 inline void
1439  DRV_ADC0_Close ( void ) ;
1440 
1441 inline void
1442  DRV_ADC1_Open ( void ) ;
1443 
1444 inline void
1445  DRV_ADC1_Close ( void ) ;
1446 
1447 inline void
1448  DRV_ADC_Start ( void ) ;
1449 
1450 inline void
1451  DRV_ADC_Stop ( void ) ;
1452 
1453 uint32_t
1455  uint8_t bufIndex ) ;
1456 
1457 bool
1459  uint8_t bufIndex ) ;
1460  // #ifndef _DRV_ADC_STATIC_H
1461 /*******************************************************************************
1462  End of File
1463 */
1464 
1465 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1466 /* CLOSE_FILE Include File */
1467 
1468 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1469 /*******************************************************************************
1470  Timer Driver Interface Declarations for Static Single Instance Driver
1471  Company:
1472  Microchip Technology Inc.
1473  File Name:
1474  drv_tmr_static.h
1475  Summary:
1476  Timer driver interface declarations for the static single instance driver.
1477  Description:
1478  The Timer device driver provides a simple interface to manage the Timer
1479  modules on Microchip microcontrollers. This file defines the interface
1480  Declarations for the TMR driver.
1481 
1482  Remarks:
1483  Static interfaces incorporate the driver instance number within the names
1484  of the routines, eliminating the need for an object ID or object handle.
1485 
1486  Static single-open interfaces also eliminate the need for the open handle.
1487 *******************************************************************************/
1488 //DOM-IGNORE-BEGIN
1489 /*******************************************************************************
1490 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1491 Microchip licenses to you the right to use, modify, copy and distribute
1492 Software only when embedded on a Microchip microcontroller or digital signal
1493 controller that is integrated into your product or third party product
1494 (pursuant to the sublicense terms in the accompanying license agreement).
1495 You should refer to the license agreement accompanying this Software for
1496 additional information regarding your rights and obligations.
1497 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1498 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1499 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1500 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1501 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1502 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1503 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1504 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1505 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1506 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1507 *******************************************************************************/
1508 //DOM-IGNORE-END
1509 #ifndef _DRV_TMR_STATIC_H
1510 #define _DRV_TMR_STATIC_H
1511 // *****************************************************************************
1512 // *****************************************************************************
1513 // Section: Include Headers
1514 // *****************************************************************************
1515 // *****************************************************************************
1516 #include <stdint.h>
1517 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1518 /*******************************************************************************
1519  Timer Device Driver Interface Definition
1520  Company:
1521  Microchip Technology Inc.
1522  File Name:
1523  drv_tmr.h
1524  Summary:
1525  Timer device driver interface header file.
1526  Description:
1527  This header file contains the function prototypes and definitions of the
1528  data types and constants that make up the interface to the Timer device
1529  driver.
1530 *******************************************************************************/
1531 //DOM-IGNORE-BEGIN
1532 /*******************************************************************************
1533 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1534 Microchip licenses to you the right to use, modify, copy and distribute
1535 Software only when embedded on a Microchip microcontroller or digital signal
1536 controller that is integrated into your product or third party product
1537 (pursuant to the sublicense terms in the accompanying license agreement).
1538 You should refer to the license agreement accompanying this Software for
1539 additional information regarding your rights and obligations.
1540 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1541 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1542 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1543 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1544 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1545 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1546 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1547 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1548 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1549 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1550 *******************************************************************************/
1551 //DOM-IGNORE-END
1552 #ifndef _DRV_TMR_H
1553 #define _DRV_TMR_H
1554 // *****************************************************************************
1555 // *****************************************************************************
1556 // Section: File includes
1557 // *****************************************************************************
1558 // *****************************************************************************
1559 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1560 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1561 #include "peripheral/tmr/plib_tmr.h"
1562 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1563 /*******************************************************************************
1564  Timer Device Driver Interface Definition
1565  Company:
1566  Microchip Technology Inc.
1567  File Name:
1568  tmr_definitions_pic32m.h
1569  Summary:
1570  Timer device driver definitions header file.
1571  Description:
1572  This header file contains the definitions of the
1573  data types and constants that make up the interface to the Timer device
1574  driver.
1575 *******************************************************************************/
1576 //DOM-IGNORE-BEGIN
1577 /*******************************************************************************
1578 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1579 Microchip licenses to you the right to use, modify, copy and distribute
1580 Software only when embedded on a Microchip microcontroller or digital signal
1581 controller that is integrated into your product or third party product
1582 (pursuant to the sublicense terms in the accompanying license agreement).
1583 You should refer to the license agreement accompanying this Software for
1584 additional information regarding your rights and obligations.
1585 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1586 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1587 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1588 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1589 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1590 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1591 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1592 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1593 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1594 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1595 *******************************************************************************/
1596 //DOM-IGNORE-END
1597 #ifndef _TMR_DEFINITIONS_PIC32M_H
1598 #define _TMR_DEFINITIONS_PIC32M_H
1599 // DOM-IGNORE-BEGIN
1600 // DOM-IGNORE-END
1601 
1602 typedef
1603  enum
1604  {
1605  /* Clock input to the timer module is internal(Peripheral Clock) */
1607  /*DOM-IGNORE-BEGIN*/
1608  = 0x00 /*DOM-IGNORE-END*/
1609  ,
1610  /* Clock input to the timer module is from T1CK pin (external)
1611  with clock synchronization enabled */
1613  /*DOM-IGNORE-BEGIN*/
1614  = 0x01 /*DOM-IGNORE-END*/
1615  ,
1616  /* Clock input to the timer module is from T1CK pin (external)
1617  with clock synchronization disabled */
1619  /*DOM-IGNORE-BEGIN*/
1620  = 0x11 /*DOM-IGNORE-END*/
1621  ,
1622  /* Clock input to the timer module is from secondary oscillator (external)
1623  with clock synchronization enabled */
1625  /*DOM-IGNORE-BEGIN*/
1626  = 0x02 /*DOM-IGNORE-END*/
1627  ,
1628  /* Clock input to the timer module is from secondary oscillator (external)
1629  with clock synchronization disabled */
1631  /*DOM-IGNORE-BEGIN*/
1632  = 0x12 /*DOM-IGNORE-END*/
1633  ,
1634  /* Clock input to the timer module is from LPRC
1635  with clock synchronization enabled */
1637  /*DOM-IGNORE-BEGIN*/
1638  = 0x03 /*DOM-IGNORE-END*/
1639  ,
1640  /* Clock input to the timer module is from LPRC
1641  with clock synchronization disabled */
1643  /*DOM-IGNORE-BEGIN*/
1644  = 0x13 /*DOM-IGNORE-END*/
1646 //DOM-IGNORE-BEGIN
1647 //DOM-IGNORE-END
1648  // #ifndef _DRV_TMR_H
1649 /*******************************************************************************
1650  End of File
1651 */
1652 
1653 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1654 /* CLOSE_FILE Include File */
1655 
1656 #include "system/int/sys_int.h" // System Interrupt Definitions
1657 #include "system/clk/sys_clk.h"
1658 // DOM-IGNORE-BEGIN
1659 // DOM-IGNORE-END
1660 // *****************************************************************************
1661 // *****************************************************************************
1662 // Section: TMR Driver Data Types
1663 // *****************************************************************************
1664 // *****************************************************************************
1665 // *****************************************************************************
1666 /* Timer Driver Module Index Numbers
1667  Summary:
1668  Timer driver index definitions
1669  Description:
1670  These constants provide Timer driver index definitions.
1671  Remarks:
1672  These constants should be used in place of hard-coded numeric literals.
1673  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1674  functions to identify the driver instance in use.
1675 */
1676 #define DRV_TMR_INDEX_0 0
1677 #define DRV_TMR_INDEX_1 1
1678 #define DRV_TMR_INDEX_2 2
1679 #define DRV_TMR_INDEX_3 3
1680 #define DRV_TMR_INDEX_4 4
1681 #define DRV_TMR_INDEX_5 5
1682 #define DRV_TMR_INDEX_6 6
1683 #define DRV_TMR_INDEX_7 7
1684 #define DRV_TMR_INDEX_8 8
1685 #define DRV_TMR_INDEX_9 9
1686 #define DRV_TMR_INDEX_10 10
1687 #define DRV_TMR_INDEX_11 11
1688 // *****************************************************************************
1689 /* Timer Driver Module Index Count
1690  Summary:
1691  Number of valid Timer driver indices.
1692  Description:
1693  This constant identifies Timer driver index definitions.
1694  Remarks:
1695  This constant should be used in place of hard-coded numeric literals.
1696  This value is device-specific.
1697 */
1698 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1699 // *****************************************************************************
1700 /* Timer Driver Client Status
1701  Summary:
1702  Identifies the client-specific status of the Timer driver
1703  Description:
1704  This enumeration identifies the client-specific status of the Timer driver.
1705  Remarks:
1706  None.
1707 */
1708 
1709 typedef
1710  enum
1711  {
1712  /* Driver is invalid (or unopened) state */
1714  /*DOM-IGNORE-BEGIN*/
1715  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1716  ,
1717  /* An operation is currently in progress */
1719  /*DOM-IGNORE-BEGIN*/
1720  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1721  ,
1722  /* Ready, no operations running */
1724  /*DOM-IGNORE-BEGIN*/
1725  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1726  ,
1727  /* Timer started and running, processing transactions */
1729  /*DOM-IGNORE-BEGIN*/
1730  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1732 // *****************************************************************************
1733 /* Timer Driver Clock sources
1734  Summary:
1735  Lists the clock sources available for timer driver.
1736  Description:
1737  This enumeration lists all the available clock sources for the timer
1738  hardware.
1739  Remarks:
1740  Not all modes are available on all devices.
1741  'Synchronization' may not be applicable for all the instances of the timer.
1742  The driver discards the Synchronization mode selected if it is not
1743  applicable for the selected hardware.
1744 */
1745 // *****************************************************************************
1746 /* Timer Driver Operation mode
1747  Summary:
1748  Lists the operation modes available for timer driver.
1749  Description:
1750  This enumeration lists all the available operation modes that are valid for
1751  the timer hardware.
1752  Remarks:
1753  Not all modes are available on all devices.
1754 */
1755 
1756 typedef
1757  enum
1758  {
1759  /* The timer module operating mode none/invalid */
1761  /* The timer module operates in 16 bit mode */
1763  /* The timer module operates in 32 bit mode */
1764  /* This will combine two 16 bit timer modules */
1767 // *****************************************************************************
1768 /* Timer Driver divider operating specification
1769  Summary:
1770  This data structure specifies the divider values that can be obtained by the
1771  timer module.
1772  Description:
1773  This data structure specifies the divider values that can be obtained by the
1774  timer hardware.
1775  Remarks:
1776  None.
1777 */
1778 
1779 typedef
1780  struct
1781  {
1782  /* The minimum divider value that the timer module can obtain */
1783  uint32_t dividerMin ;
1784  /* The maximum divider value that the timer module can obtain */
1785  uint32_t dividerMax ;
1786  /* The divider step value, between 2 divider values */
1787  /* Should be 1 for most timers */
1788  uint32_t dividerStep ;
1790 // *****************************************************************************
1791 /* Timer Driver Initialize Data
1792  Summary:
1793  Defines the Timer driver initialization data.
1794  Description:
1795  This data type defines data required to initialize the Timer driver.
1796  Remarks:
1797  Not all initialization features are available on all devices.
1798 */
1799 
1800 typedef
1801  struct
1802  {
1803  /* System module initialization. */
1804  SYS_MODULE_INIT moduleInit ;
1805  /* Identifies timer hardware module (PLIB-level) ID */
1806  TMR_MODULE_ID tmrId ;
1807  /* Clock Source select. */
1808  DRV_TMR_CLK_SOURCES clockSource ;
1809  /* Prescaler Selection from the processor enumeration */
1810  TMR_PRESCALE prescale ;
1811  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1812  is selected the interrupt will be generated by the 2nd timer of the pair,
1813  the odd numbered one. */
1814  INT_SOURCE interruptSource ;
1815  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1816  timer modules to form a 32 bit one. This is usually only necessary for
1817  very long delays. */
1818  DRV_TMR_OPERATION_MODE mode ;
1819  /* Asynchronous write enable configuration. If true the asynchronous write
1820  is enabled. For timers that do not support this feature the value is
1821  ignored */
1822  bool asyncWriteEnable ;
1823  } DRV_TMR_INIT ;
1824 // *****************************************************************************
1825 /* Timer Driver Callback Function Pointer
1826  Summary:
1827  Pointer to a Timer driver callback function data type.
1828  Description:
1829  This data type defines a pointer to a Timer driver callback function.
1830  Remarks:
1831  Useful only when timer alarm callback support is enabled by defining the
1832  DRV_TMR_ALARM_ENABLE configuration option.
1833 */
1834 
1835 typedef
1836 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1837 uint32_t alarmCount ) ;
1838 // *****************************************************************************
1839 // *****************************************************************************
1840 // Section: Timer Driver Module Interface Functions
1841 // *****************************************************************************
1842 // *****************************************************************************
1843 // *****************************************************************************
1844 /* Function:
1845  SYS_MODULE_OBJ DRV_TMR_Initialize
1846  (
1847  const SYS_MODULE_INDEX drvIndex,
1848  const SYS_MODULE_INIT * const init
1849  )
1850  Summary:
1851  Initializes the Timer driver.
1852  <p><b>Implementation:</b> Static/Dynamic</p>
1853  Description:
1854  This function initializes the Timer driver, making it ready for clients to
1855  open and use it.
1856  Precondition:
1857  None.
1858  Parameters:
1859  drvIndex - Index for the driver instance to be initialized
1860  init - Pointer to a data structure containing any data necessary
1861  to initialize the driver.
1862  Returns:
1863  If successful, returns a valid handle to a driver object. Otherwise, it
1864  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1865  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1866  Example:
1867  <code>
1868  DRV_TMR_INIT init;
1869  SYS_MODULE_OBJ objectHandle;
1870  // Populate the timer initialization structure
1871  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1872  init.tmrId = TMR_ID_2;
1873  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1874  init.prescale = TMR_PRESCALE_VALUE_256;
1875  init.interruptSource = INT_SOURCE_TIMER_2;
1876  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1877  init.asyncWriteEnable = false;
1878  // Do something
1879  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1880  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1881  {
1882  // Handle error
1883  }
1884  </code>
1885  Remarks:
1886  This function must be called before any other Timer driver function is
1887  called.
1888  This function should only be called once during system initialization unless
1889  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1890  This function will NEVER block for hardware access. The system must use
1891  DRV_TMR_Status to find out when the driver is in the ready state.
1892  Build configuration options may be used to statically override options in
1893  the "init" structure and will take precedence over initialization data
1894  passed using this function.
1895 */
1896 
1897 SYS_MODULE_OBJ
1899  const SYS_MODULE_INDEX drvIndex ,
1900  const SYS_MODULE_INIT * const init ) ;
1901 // *****************************************************************************
1902 /* Function:
1903  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1904  Summary:
1905  Deinitializes the specified instance of the Timer driver.
1906  <p><b>Implementation:</b> Dynamic</p>
1907  Description:
1908  Deinitializes the specified instance of the Timer driver, disabling
1909  its operation (and any hardware). All internal data is invalidated.
1910  Precondition:
1911  The DRV_TMR_Initialize function must have been called before calling this
1912  function and a valid SYS_MODULE_OBJ must have been returned.
1913  Parameters:
1914  object - Driver object handle, returned from DRV_TMR_Initialize
1915  Returns:
1916  None.
1917  Example:
1918  <code>
1919  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1920  SYS_STATUS tmrStatus;
1921  DRV_TMR_Deinitialize ( tmrObject );
1922  tmrStatus = DRV_TMR_Status ( tmrObject );
1923  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1924  {
1925  // Check again later if you need to know
1926  // when the driver is deinitialized.
1927  }
1928  </code>
1929  Remarks:
1930  Once the Initialize operation has been called, the Deinitialize operation
1931  must be called before the Initialize operation can be called again.
1932  This function will NEVER block waiting for hardware. If the operation
1933  requires time to allow the hardware to complete, this will be reported by
1934  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1935  out when the module is in the ready state.
1936 */
1937 
1938 void
1940  SYS_MODULE_OBJ object ) ;
1941 // *****************************************************************************
1942 /* Function:
1943  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1944  Summary:
1945  Provides the current status of the Timer driver.
1946  <p><b>Implementation:</b> Dynamic</p>
1947  Description:
1948  This function provides the current status of the Timer driver.
1949  Precondition:
1950  The DRV_TMR_Initialize function must have been called before calling this
1951  function.
1952  Parameters:
1953  object - Driver object handle, returned from DRV_TMR_Initialize
1954  Returns:
1955  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1956  for operation
1957  Note: Any value greater than SYS_STATUS_READY is
1958  also a normal running state in which the driver
1959  is ready to accept new operations.
1960  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1961  Note: Any value less than SYS_STATUS_ERROR is
1962  also an error state.
1963  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1964  Note: This value is less than SYS_STATUS_ERROR.
1965  Example:
1966  <code>
1967  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1968  SYS_STATUS tmrStatus;
1969  tmrStatus = DRV_TMR_Status ( object );
1970  else if ( SYS_STATUS_ERROR >= tmrStatus )
1971  {
1972  // Handle error
1973  }
1974  </code>
1975  Remarks:
1976  The this operation can be used to determine when any of the driver's module
1977  level operations has completed.
1978  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1979  operation.
1980  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1981  also an error state.
1982  This function will NEVER block waiting for hardware.
1983 */
1984 
1985 SYS_STATUS
1986  DRV_TMR_Status (
1987  SYS_MODULE_OBJ object ) ;
1988 // *****************************************************************************
1989 /* Function:
1990  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1991  Summary:
1992  Maintains the driver's state machine.
1993  <p><b>Implementation:</b> Dynamic</p>
1994  Description:
1995  This function is used to maintain the driver's internal state machine and
1996  processes the timer events..
1997  Precondition:
1998  The DRV_TMR_Initialize function must have been called for the specified Timer
1999  driver instance.
2000  Parameters:
2001  object - Object handle for the specified driver instance (returned from
2002  DRV_TMR_Initialize)
2003  Returns:
2004  None
2005  Example:
2006  <code>
2007  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2008  while (true)
2009  {
2010  DRV_TMR_Tasks ( object );
2011  // Do other tasks
2012  }
2013  </code>
2014  Remarks:
2015  This function is normally not called directly by an application. It is
2016  called by the system's Tasks routine (SYS_Tasks)
2017 */
2018 
2019 void
2020  DRV_TMR_Tasks (
2021  SYS_MODULE_OBJ object ) ;
2022 // *****************************************************************************
2023 // *****************************************************************************
2024 // Section: TMR Driver Client Functions
2025 // *****************************************************************************
2026 // *****************************************************************************
2027 // *****************************************************************************
2028 /* Function:
2029  DRV_HANDLE DRV_TMR_Open
2030  (
2031  const SYS_MODULE_INDEX index,
2032  const DRV_IO_INTENT intent
2033  )
2034  Summary:
2035  Opens the specified Timer driver instance and returns a handle to it.
2036  <p><b>Implementation:</b> Dynamic</p>
2037  Description:
2038  This function opens the specified Timer driver instance and provides a
2039  handle that must be provided to all other client-level operations to
2040  identify the caller and the instance of the driver. Timer driver does not
2041  support multiple clients. If two tasks want to use the timer, one should
2042  wait until the other one gets closed.
2043  Precondition:
2044  The DRV_TMR_Initialize function must have been called before calling this
2045  function.
2046  Parameters:
2047  index - Identifier for the object instance to be opened
2048  intent - Zero or more of the values from the enumeration
2049  DRV_IO_INTENT ORed together to indicate the intended use
2050  of the driver
2051  Returns:
2052  If successful, the function returns a valid open instance handle (a number
2053  identifying both the caller and the module instance).
2054  If an error occurs, the return value is DRV_HANDLE_INVALID.
2055  Example:
2056  <code>
2057  DRV_HANDLE handle;
2058  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2059  if ( DRV_HANDLE_INVALID == handle )
2060  {
2061  // Unable to open the driver
2062  }
2063  </code>
2064  Remarks:
2065  The handle returned is valid until the DRV_TMR_Close function is called.
2066  This function will NEVER block waiting for hardware.
2067  If the requested intent flags are not supported, the function will return
2068  DRV_HANDLE_INVALID.
2069  The Timer driver does not support DRV_IO_INTENT_SHARED.
2070  Only exclusive access is supported for now.
2071 */
2072 
2073 DRV_HANDLE
2074  DRV_TMR_Open (
2075  const SYS_MODULE_INDEX index ,
2076  const DRV_IO_INTENT intent ) ;
2077 // *****************************************************************************
2078 /* Function:
2079  void DRV_TMR_Close ( DRV_HANDLE handle )
2080  Summary:
2081  Closes an opened instance of the Timer driver.
2082  <p><b>Implementation:</b> Dynamic</p>
2083  Description:
2084  This function closes an opened instance of the Timer driver, invalidating
2085  the handle.
2086  Precondition:
2087  The DRV_TMR_Initialize function must have been called for the specified
2088  Timer driver instance.
2089  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2090  Parameters:
2091  handle - A valid open-instance handle, returned from the driver's
2092  open routine
2093  Returns:
2094  None
2095  Example:
2096  <code>
2097  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2098  DRV_TMR_Close ( handle );
2099  </code>
2100  Remarks:
2101  After calling this function, the handle passed in "handle" must not be used
2102  with any of the remaining driver functions. A new handle must be obtained
2103  by calling DRV_TMR_Open before the caller may use the driver again.
2104  Note: Usually there is no need for the driver client to verify that the Close
2105  operation has completed.
2106 */
2107 
2108 void
2109  DRV_TMR_Close (
2110  DRV_HANDLE handle ) ;
2111 // *****************************************************************************
2112 /* Function:
2113  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2114  Summary:
2115  Gets the status of the client operation.
2116  <p><b>Implementation:</b> Dynamic</p>
2117  Description:
2118  This function gets the status of the recently completed client level
2119  operation.
2120  Precondition:
2121  The DRV_TMR_Initialize function must have been called for the specified
2122  Timer driver instance.
2123  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2124  Parameters:
2125  handle - A valid open-instance handle, returned from the driver's
2126  open routine
2127  Returns:
2128  None
2129  Example:
2130  <code>
2131  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2132  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2133  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2134  </code>
2135  Remarks:
2136  None.
2137 */
2138 
2141  DRV_HANDLE handle ) ;
2142 // *****************************************************************************
2143 // *****************************************************************************
2144 // Section: TMR Driver Counting functions
2145 // *****************************************************************************
2146 // *****************************************************************************
2147 // *****************************************************************************
2148 /* Function:
2149  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2150  Summary:
2151  Updates the Timer's counter register.
2152  <p><b>Implementation:</b> Static/Dynamic</p>
2153  Description:
2154  This function updates the Timer's value in the counter register.
2155  Precondition:
2156  The DRV_TMR_Initialize function must have been called.
2157  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2158  Parameters:
2159  handle - A valid open-instance handle, returned from the driver's
2160  open routine
2161  counterPeriod - counter period value
2162  - a 16 bit value if the timer is configured in 16 bit mode
2163  - a 32 bit value if the timer is configured in 32 bit mode
2164  Returns:
2165  None.
2166  Example:
2167  <code>
2168  </code>
2169  Remarks:
2170  None.
2171 */
2172 
2173 void
2175  DRV_HANDLE handle ,
2176  uint32_t counterPeriod ) ;
2177 // *****************************************************************************
2178 /* Function:
2179  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2180  Summary:
2181  Reads the Timer's counter register.
2182  <p><b>Implementation:</b> Static/Dynamic</p>
2183  Description:
2184  This function returns the Timer's value in the counter register.
2185  Precondition:
2186  The DRV_TMR_Initialize function must have been called.
2187  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2188  Parameters:
2189  handle - A valid open-instance handle, returned from the driver's
2190  open routine
2191  Returns:
2192  Timer current period:
2193  - a 16 bit value if the timer is configured in 16 bit mode
2194  - a 32 bit value if the timer is configured in 32 bit mode
2195  Example:
2196  <code>
2197  //Example to use timer for precision time measurement
2198  //without configuring an alarm (interrupt based)
2199  char appState = 0;
2200  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2201  switch ( appState )
2202  {
2203  case 0:
2204  //Calculate and set the counter period
2205  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2206  //counter starts
2207  DRV_TMR_Start ( tmrHandle );
2208  //Trigger an application operation
2209  app_trigger_operation();
2210  //Check for time-out in the next state
2211  appState++;
2212  case 1:
2213  //Overflows and stops at 0 if no alarm is set
2214  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2215  {
2216  //Time-out
2217  return false;
2218  }
2219  else if ( app_operation_isComplete( ) )
2220  {
2221  //Operation is complete before time-out
2222  return true;
2223  }
2224  </code>
2225  Remarks:
2226  None.
2227 */
2228 
2229 uint32_t
2231  DRV_HANDLE handle ) ;
2232 // *****************************************************************************
2233 /* Function:
2234  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2235  Summary:
2236  Clears the Timer's counter register.
2237  <p><b>Implementation:</b> Static/Dynamic</p>
2238  Description:
2239  This function clears the Timer's value in the counter register.
2240  Precondition:
2241  The DRV_TMR_Initialize function must have been called.
2242  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2243  Parameters:
2244  handle - A valid open-instance handle, returned from the driver's
2245  open routine
2246  Returns:
2247  None.
2248  Example:
2249  <code>
2250  </code>
2251  Remarks:
2252  None.
2253 */
2254 
2255 void
2257  DRV_HANDLE handle ) ;
2258 // *****************************************************************************
2259 /* Function:
2260  bool DRV_TMR_AlarmRegister
2261  (
2262  DRV_HANDLE handle,
2263  uint32_t divider,
2264  bool isPeriodic,
2265  uintptr_t context,
2266  DRV_TMR_CALLBACK callBack
2267  )
2268  Summary:
2269  Sets up an alarm.
2270  <p><b>Implementation:</b> Dynamic</p>
2271  Description:
2272  This function sets up an alarm, allowing the client to receive a callback
2273  from the driver when the timer counter reaches zero. Alarms can be one-shot
2274  or periodic. A periodic alarm will reload the timer and generate alarm
2275  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2276  divider;
2277  Precondition:
2278  The DRV_TMR_Initialize function must have been called.
2279  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2280  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2281  Parameters:
2282  handle - A valid handle, returned from DRV_TMR_Open
2283  divider - The value to divide the timer clock source to obtain the
2284  required alarm frequency.
2285  - a 16 bit value if the timer is configured in 16 bit mode
2286  - a 32 bit value if the timer is configured in 32 bit mode
2287  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2288  context - A reference, call back function will be called with the same
2289  reference.
2290  callBack - A call back function which will be called on time out.
2291  Returns:
2292  - true - if the call succeeded
2293  - false - the obtained divider could not be obtained or the passed handle was invalid
2294  Example:
2295  <code>
2296  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2297  void setupTask ()
2298  {
2299  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2300  uint32_t myFreq = 1000; // 1KHz
2301  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2302  // calculate the divider needed
2303  uint32_t divider = clkFreq / myFreq;
2304  // Start the alarm
2305  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2306  {
2307  // divider value could not be obtain;
2308  // handle the error
2309  //
2310  }
2311  }
2312  </code>
2313  Remarks:
2314  The divider value will be truncated to a 16 bit value if the timer is
2315  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2316  callback.
2317 */
2318 
2319 bool
2321  DRV_HANDLE handle ,
2322  uint32_t divider ,
2323  bool isPeriodic ,
2324  uintptr_t context ,
2325  DRV_TMR_CALLBACK callBack ) ;
2326 // *****************************************************************************
2327 /* Function:
2328  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2329  Summary:
2330  Disables an alarm signal.
2331  <p><b>Implementation:</b> Dynamic</p>
2332  Description:
2333  This function allows the client to disable an alarm generation.
2334  Use DRV_TMR_AlarmEnable to re-enable.
2335  Precondition:
2336  The DRV_TMR_Initialize function must have been called.
2337  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2338  A client alarm must be active.
2339  Parameters:
2340  handle - A valid handle, returned from DRV_TMR_Open
2341  Returns:
2342  The current status of the alarm:
2343  - true if the alarm was currently enabled
2344  - false if the alarm was currently disabled
2345  Example:
2346  <code>
2347  </code>
2348  Remarks:
2349  When the driver operates in interrupts this call resolves to a device
2350  interrupt disable.
2351  Do NOT disable the timer except for very short periods of time. If the time
2352  that the interrupt is disabled is longer than a wrap around period and the
2353  interrupt is missed, the hardware has no means of recovering and the
2354  resulting timing will be inaccurate.
2355 */
2356 
2357 bool
2359  DRV_HANDLE handle ) ;
2360 // *****************************************************************************
2361 /* Function:
2362  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2363  Summary:
2364  Re-enables an alarm signal.
2365  <p><b>Implementation:</b> Dynamic</p>
2366  Description:
2367  This function allows the client to re-enable an alarm after it has been
2368  disabled by a DRV_TMR_AlarmDisable call.
2369  Precondition:
2370  The DRV_TMR_Initialize function must have been called.
2371  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2372  Parameters:
2373  handle - A valid handle, returned from DRV_TMR_Open
2374  enable - boolean to enable the current callback
2375  Returns:
2376  None
2377  Example:
2378  <code>
2379  </code>
2380  Remarks:
2381  When the driver operates in interrupts this call resolves to a device
2382  interrupt re-enable.
2383 */
2384 
2385 void
2387  DRV_HANDLE handle ,
2388  bool enable ) ;
2389 // *****************************************************************************
2390 /* Function:
2391  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2392  Summary:
2393  Updates the Timer's period.
2394  <p><b>Implementation:</b> Dynamic</p>
2395  Description:
2396  This function updates the Timer's period.
2397  Precondition:
2398  The DRV_TMR_Initialize function must have been called.
2399  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2400  Parameters:
2401  handle - A valid open-instance handle, returned from the driver's
2402  open routine
2403  value - Period value
2404  - a 16 bit value if the timer is configured in 16 bit mode
2405  - a 32 bit value if the timer is configured in 32 bit mode
2406  Returns:
2407  None.
2408  Example:
2409  <code>
2410  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2411  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2412  </code>
2413  Remarks:
2414  - The period value will be truncated to a 16 bit value if the timer is
2415  configured in 16 bit mode.
2416 */
2417 
2418 void
2420  DRV_HANDLE handle ,
2421  uint32_t value ) ;
2422 // *****************************************************************************
2423 /* Function:
2424  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2425  Summary:
2426  Provides the Timer's period.
2427  <p><b>Implementation:</b> Dynamic</p>
2428  Description:
2429  This function gets the Timer's period.
2430  Precondition:
2431  The DRV_TMR_Initialize function must have been called.
2432  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2433  Parameters:
2434  handle - A valid open-instance handle, returned from the driver's
2435  open routine
2436  Returns:
2437  Timer period value:
2438  - a 16 bit value if the timer is configured in 16 bit mode
2439  - a 32 bit value if the timer is configured in 32 bit mode
2440  Example:
2441  <code>
2442  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2443  uint32_t period;
2444  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2445  </code>
2446  Remarks:
2447  None.
2448 */
2449 
2450 uint32_t
2452  DRV_HANDLE handle ) ;
2453 // *****************************************************************************
2454 /* Function:
2455  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2456  Summary:
2457  Removes a previously set alarm.
2458  <p><b>Implementation:</b> Dynamic</p>
2459  Description:
2460  This function removes a previously set alarm.
2461  Precondition:
2462  The DRV_TMR_Initialize function must have been called.
2463  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2464  DRV_TMR_AlarmRegister function must have been called before.
2465  Parameters:
2466  handle - A valid open-instance handle, returned from the driver's
2467  open routine
2468  Returns:
2469  None.
2470  Example:
2471  <code>
2472  // Example of a key debounce check
2473  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2474  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2475  void keyPressDetect ()
2476  {
2477  // Calculate the count to be passed on from the clock input
2478  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2479  }
2480  void DebounceCheck ( uintptr_t context )
2481  {
2482  readKey = AppReadKey();
2483  if ( readKey != lastReadKey )
2484  {
2485  lastReadKey = readKey;
2486  keyCount = 0;
2487  }
2488  else
2489  {
2490  if ( keyCount > 20 )
2491  {
2492  globalKeyState = readKey;
2493  DRV_TMR_AlarmDeregister ( tmrHandle );
2494  }
2495  keyCount++;
2496  }
2497  }
2498  </code>
2499  Remarks:
2500  None.
2501 */
2502 
2503 void
2505  DRV_HANDLE handle ) ;
2506 // *****************************************************************************
2507 // *****************************************************************************
2508 // Section: TMR Driver Operation Control Functions
2509 // *****************************************************************************
2510 // *****************************************************************************
2511 // *****************************************************************************
2512 /* Function:
2513  bool DRV_TMR_Start ( DRV_HANDLE handle )
2514  Summary:
2515  Starts the Timer counting.
2516  <p><b>Implementation:</b> Static/Dynamic</p>
2517  Description:
2518  This function starts the Timer counting.
2519  Precondition:
2520  The DRV_TMR_Initialize function must have been called.
2521  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2522  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2523  Parameters:
2524  handle - A valid open-instance handle, returned from the driver's
2525  open routine
2526  Returns:
2527  - true - if the operation succeeded
2528  - false - the supplied handle is invalid or the client doesn't have
2529  the needed parameters to run (alarm callback and period )
2530  Example:
2531  <code>
2532  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2533  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2534  DRV_TMR_Start ( tmrHandle );
2535  </code>
2536  Remarks:
2537  None.
2538 */
2539 
2540 bool
2541  DRV_TMR_Start (
2542  DRV_HANDLE handle ) ;
2543 // *****************************************************************************
2544 /* Function:
2545  void DRV_TMR_Stop ( DRV_HANDLE handle )
2546  Summary:
2547  Stops the Timer from counting.
2548  <p><b>Implementation:</b> Static/Dynamic</p>
2549  Description:
2550  This function stops the running Timer from counting.
2551  Precondition:
2552  The DRV_TMR_Initialize function must have been called.
2553  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2554  Parameters:
2555  handle - A valid open-instance handle, returned from the driver's
2556  open routine
2557  Returns:
2558  None.
2559  Example:
2560  <code>
2561  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2562  DRV_TMR_Stop ( handle );
2563  </code>
2564  Remarks:
2565  None.
2566 */
2567 
2568 void
2569  DRV_TMR_Stop (
2570  DRV_HANDLE handle ) ;
2571 // *****************************************************************************
2572 // *****************************************************************************
2573 // Section: TMR Driver Operation Status Functions
2574 // *****************************************************************************
2575 // *****************************************************************************
2576 // *****************************************************************************
2577 /* Function:
2578  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2579  Summary:
2580  Provides the status of Timer's period elapse.
2581  <p><b>Implementation:</b> Dynamic</p>
2582  Description:
2583  This function returns the number of times Timer's period has elapsed since
2584  last call to this API has made. On calling this API, the internally
2585  maintained counter will be cleared and count will be started again from next
2586  elapse.
2587  Precondition:
2588  The DRV_TMR_Initialize function must have been called.
2589  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2590  Parameters:
2591  handle - A valid handle, returned from the DRV_TMR_Open
2592  Returns:
2593  Number of times timer has elapsed since the last call.
2594  Example:
2595  <code>
2596  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2597  bool elapseStatus;
2598  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2599  unsigned int appInternalTime = 0;
2600  Sys_Tasks()
2601  {
2602  //Timer task will be called from ISR
2603  APP_TimeUpdate_Task();
2604  //Other Tasks
2605  }
2606  void APP_TimeUpdate_Task ( void )
2607  {
2608  //We will not miss a count even though we are late
2609  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2610  }
2611  </code>
2612  Remarks:
2613  None.
2614 */
2615 
2616 uint32_t
2618  DRV_HANDLE handle ) ;
2619 // *****************************************************************************
2620 // *****************************************************************************
2621 // Section: TMR Driver Control and Information Functions
2622 // *****************************************************************************
2623 // *****************************************************************************
2624 // *****************************************************************************
2625 /* Function:
2626  bool DRV_TMR_ClockSet
2627  (
2628  DRV_HANDLE handle,
2629  DRV_TMR_CLK_SOURCES clockSource,
2630  TMR_PRESCALE preScale
2631  )
2632  Summary:
2633  Sets the timers clock by selecting the source and prescaler.
2634  <p><b>Implementation:</b> Dynamic</p>
2635  Description:
2636  This function sets the timer clock by selecting the source and prescaler.
2637  The clock sources are device specific, refer device datasheet for supported
2638  clock sources. If unsupported clock source is passed then the behaviour of
2639  this function is unpredictable.
2640  Precondition:
2641  The DRV_TMR_Initialize function must have been called. Must have selected
2642  32-Bit timer mode if mode selection is applicable.
2643  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2644  Parameters:
2645  handle - A valid open-instance handle, returned from the driver's
2646  open routine
2647  clockSource - Clock source of the timer
2648  preScale - Timer's Prescaler divisor
2649  Returns:
2650  - true - if the operation is successful
2651  - false - either the handle is invalid or the clockSource
2652  and/or prescaler are not supported
2653  Example:
2654  <code>
2655  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2656  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2657  </code>
2658  Remarks:
2659  None.
2660 */
2661 
2662 bool
2664  DRV_HANDLE handle ,
2665  DRV_TMR_CLK_SOURCES clockSource ,
2666  TMR_PRESCALE preScale ) ;
2667 // *****************************************************************************
2668 /* Function:
2669  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2670  Summary:
2671  This function gets the currently selected prescaler.
2672  <p><b>Implementation:</b> Dynamic</p>
2673  Description:
2674  This function gets the currently selected prescaler.
2675  Precondition:
2676  The DRV_TMR_Initialize function must have been called.
2677  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2678  Parameters:
2679  handle - A valid open-instance handle, returned from the driver's
2680  open routine
2681  Returns:
2682  Timer prescaler.
2683  Example:
2684  <code>
2685  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2686  TMR_PRESCALE preScale;
2687  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2688  </code>
2689  Remarks:
2690  None.
2691 */
2692 
2693 TMR_PRESCALE
2695  DRV_HANDLE handle ) ;
2696 // *****************************************************************************
2697 /* Function:
2698  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2699  Summary:
2700  This function gets the currently selected operation mode.
2701  <p><b>Implementation:</b> Dynamic</p>
2702  Description:
2703  This function gets the currently selected 16/32 bit operation mode.
2704  Precondition:
2705  The DRV_TMR_Initialize function must have been called.
2706  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2707  Parameters:
2708  handle - A valid open-instance handle, returned from the driver's
2709  open routine
2710  Returns:
2711  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2712  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2713  handle.
2714  Example:
2715  <code>
2716  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2717  DRV_TMR_OPERATION_MODE operMode;
2718  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2719  </code>
2720  Remarks:
2721  None.
2722 */
2723 
2726  DRV_HANDLE handle ) ;
2727 // *****************************************************************************
2728 /* Function:
2729  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2730  Summary:
2731  Enables the Gate mode.
2732  <p><b>Implementation:</b> Dynamic</p>
2733  Description:
2734  This function enables the Gated mode of Timer. User can measure the duration
2735  of an external signal in this mode. Once the Gate mode is enabled, Timer
2736  will start on the raising edge of the external signal. It will keep counting
2737  until the next falling edge.
2738  Precondition:
2739  The DRV_TMR_Initialize function must have been called.
2740  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2741  Parameters:
2742  handle - A valid open-instance handle, returned from the driver's
2743  open routine
2744  Returns:
2745  - true - if the operation is successful
2746  - false - either the handle is invalid or the gate mode
2747  is not supported
2748  Example:
2749  <code>
2750  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2751  DRV_TMR_GateModeSet ( tmrHandle );
2752  </code>
2753  Remarks:
2754  None.
2755 */
2756 
2757 bool
2759  DRV_HANDLE handle ) ;
2760 // *****************************************************************************
2761 /* Function:
2762  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2763  Summary:
2764  Enables the Gate mode.
2765  <p><b>Implementation:</b> Dynamic</p>
2766  Description:
2767  This function enables the Gated mode of Timer. User can measure the duration
2768  of an external signal in this mode. Once the Gate mode is enabled, Timer
2769  will start on the raising edge of the external signal. It will keep counting
2770  until the next falling edge.
2771  Precondition:
2772  The DRV_TMR_Initialize function must have been called.
2773  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2774  Parameters:
2775  handle - A valid open-instance handle, returned from the driver's
2776  open routine
2777  Returns:
2778  - true - if the operation is successful
2779  - false - either the handle is invalid or the gate mode
2780  is not supported
2781  Example:
2782  <code>
2783  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2784  DRV_TMR_GateModeClear ( tmrHandle );
2785  </code>
2786  Remarks:
2787  None.
2788 */
2789 
2790 bool
2792  DRV_HANDLE handle ) ;
2793 // *****************************************************************************
2794 /* Function:
2795  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2796  Summary:
2797  Provides the Timer input frequency.
2798  <p><b>Implementation:</b> Dynamic</p>
2799  Description:
2800  This function provides the Timer input frequency. Input frequency is the
2801  clock to the Timer register and it is considering the prescaler divisor.
2802  Precondition:
2803  The DRV_TMR_Initialize function must have been called.
2804  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2805  Parameters:
2806  handle - A valid open-instance handle, returned from the driver's
2807  open routine
2808  Returns:
2809  32-bit value corresponding to the running frequency.
2810  If Timer clock source is external, then this function returns 0.
2811  Example:
2812  <code>
2813  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2814  uint32_t clkFreqHz;
2815  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2816  </code>
2817  Remarks:
2818  On most processors, the Timer's base frequency is the same as the peripheral
2819  bus clock.
2820 */
2821 
2822 uint32_t
2824  DRV_HANDLE handle ) ;
2825 // *****************************************************************************
2826 /* Function:
2827  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2828  (
2829  DRV_HANDLE handle,
2830  DRV_TMR_DIVIDER_RANGE* pDivRange
2831  )
2832  Summary:
2833  Returns the Timer divider values.
2834  <p><b>Implementation:</b> Dynamic</p>
2835  Description:
2836  This function provides the Timer operating mode and divider range.
2837  Precondition:
2838  The DRV_TMR_Initialize function must have been called.
2839  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2840  Parameters:
2841  handle - A valid open-instance handle, returned from the driver's
2842  open routine
2843  pDivRange - Address to store the timer divider range.
2844  Returns:
2845  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2846  The pDivRange is updated with the supported range values.
2847  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2848  Example:
2849  <code>
2850  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2851  DRV_TMR_OPERATION_MODE timerMode;
2852  DRV_TMR_DIVIDER_RANGE timerRange;
2853  DRV_TMR_DividerRangeGet(handle, &timerRange);
2854  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2855  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2856  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2857  </code>
2858  Remarks:
2859  None.
2860 */
2861 
2864  DRV_HANDLE handle ,
2865  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2866 // *****************************************************************************
2867 // *****************************************************************************
2868 // Section: File includes for the APIs which are required for backward
2869 // compatibility.
2870 // *****************************************************************************
2871 // *****************************************************************************
2872 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2873 /*******************************************************************************
2874  Timer Device Driver Interface Definition
2875  Company:
2876  Microchip Technology Inc.
2877  File Name:
2878  drv_tmr_compatibility.h
2879  Summary:
2880  Timer device driver interface header file.
2881  Description:
2882  This header file contains macro definition for APIs which will be deprecated
2883  later. This header file is included in drv_tmr.h.
2884 *******************************************************************************/
2885 //DOM-IGNORE-BEGIN
2886 /*******************************************************************************
2887 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2888 Microchip licenses to you the right to use, modify, copy and distribute
2889 Software only when embedded on a Microchip microcontroller or digital signal
2890 controller that is integrated into your product or third party product
2891 (pursuant to the sublicense terms in the accompanying license agreement).
2892 You should refer to the license agreement accompanying this Software for
2893 additional information regarding your rights and obligations.
2894 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2895 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2896 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2897 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2898 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2899 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2900 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2901 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2902 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2903 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2904 *******************************************************************************/
2905 //DOM-IGNORE-END
2906 #ifndef _DRV_TMR_DEPRECATED_H
2907 #define _DRV_TMR_DEPRECATED_H
2908 // *****************************************************************************
2909 // *****************************************************************************
2910 // Section: File includes
2911 // *****************************************************************************
2912 // *****************************************************************************
2913 // *****************************************************************************
2914 /* Function:
2915  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2916  Summary:
2917  Maintains the driver's state machine, processes the events and implements
2918  its ISR.
2919  <p><b>Implementation:</b> Dynamic</p>
2920  Description:
2921  This function is used to maintain the driver's internal state machine and
2922  processes the timer events in interrupt-driven implementations
2923  (DRV_TMR_INTERRUPT_MODE == true).
2924  Precondition:
2925  The DRV_TMR_Initialize function must have been called for the specified Timer
2926  driver instance.
2927  Parameters:
2928  object - Object handle for the specified driver instance (returned from
2929  DRV_TMR_Initialize)
2930  Returns:
2931  None
2932  Example:
2933  <code>
2934  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2935  {
2936  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2937  }
2938  </code>
2939  Remarks:
2940  This function is normally not called directly by an application.
2941  It is called by the timer driver raw ISR.
2942  This function will execute in an ISR context and will never block or access any
2943  resources that may cause it to block.
2944 
2945  This function will be deprecated later, so avoid using it as much as possible.
2946  Use generic function "DRV_TMR_Tasks" instead of this.
2947 */
2948 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2949 // *****************************************************************************
2950 /* Function:
2951  void DRV_TMR_CounterValue16BitSet
2952  (
2953  DRV_HANDLE handle,
2954  uint16_t counterPeriod
2955  )
2956  Summary:
2957  Updates the 16-bit Timer's counter register.
2958  <p><b>Implementation:</b> Dynamic</p>
2959  Description:
2960  This function updates the 16-bit Timer's value in the counter register. This
2961  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2962  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2963  DRV_TMR_CounterValue32BitSet function.
2964  Precondition:
2965  The DRV_TMR_Initialize function must have been called. Must have selected
2966  16-Bit timer mode if mode selection is applicable.
2967  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2968  Parameters:
2969  handle - A valid open-instance handle, returned from the driver's
2970  open routine
2971  counterPeriod - 16-bit counter period value
2972  Returns:
2973  None.
2974  Example:
2975  <code>
2976  //Example to use timer for precision time measurement
2977  //without configuring an alarm (interrupt based)
2978  char appState = 0;
2979  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2980 
2981  switch ( appState )
2982  {
2983  case 0:
2984  //Calculate and set the counter period
2985  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2986 
2987  //counter starts
2988  DRV_TMR_Start ( tmrHandle );
2989 
2990  //Trigger an application operation
2991  app_trigger_operation();
2992 
2993  //Check for time-out in the next state
2994  appState++;
2995  case 1:
2996  //Overflows and stops at 0 if no alarm is set
2997  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
2998  {
2999  //Time-out
3000  return false;
3001  }
3002  else if ( app_operation_isComplete( ) )
3003  {
3004  //Operation is complete before time-out
3005  return true;
3006  }
3007  </code>
3008  Remarks:
3009  This function will be deprecated later, so avoid using it as much as possible.
3010  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3011 */
3012 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3013 // *****************************************************************************
3014 /* Function:
3015  void DRV_TMR_CounterValue32BitSet
3016  (
3017  DRV_HANDLE handle,
3018  uint32_t counterPeriod
3019  )
3020  Summary:
3021  Updates the 32-bit Timer's counter register.
3022  <p><b>Implementation:</b> Dynamic</p>
3023  Description:
3024  This function updates the 32-bit Timer's value in the counter register. This
3025  is valid only if the 32-bit mode of the timer is selected Otherwise use
3026  DRV_TMR_CounterValue16BitSet function.
3027  Precondition:
3028  The DRV_TMR_Initialize function must have been called. Must have selected
3029  32-Bit timer mode.
3030  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3031  Parameters:
3032  handle - A valid open-instance handle, returned from the driver's
3033  open routine
3034  counterPeriod - 32-bit counter period value
3035  Returns:
3036  None.
3037  Example:
3038  <code>
3039  //Example to use timer for precision time measurement
3040  //without configuring an alarm (interrupt based)
3041  char appState = 0;
3042  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3043 
3044  switch ( appState )
3045  {
3046  case 0:
3047  //Calculate and set the counter period
3048  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3049 
3050  //counter starts
3051  DRV_TMR_Start ( tmrHandle );
3052 
3053  //Trigger an application operation against which we want to use the time-out
3054  app_trigger_operation();
3055 
3056  //Check for time-out in the next state
3057  appState++;
3058  case 1:
3059  //Overflows and stops at 0 if no alarm is set
3060  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3061  {
3062  //Time-out
3063  return false;
3064  }
3065  else if ( app_operation_isComplete( ) )
3066  {
3067  //Operation is complete before time-out
3068  return true;
3069  }
3070  </code>
3071  Remarks:
3072  In most of the devices only even numbered instances of timer supports
3073  32-bit mode.
3074  This function will be deprecated later, so avoid using it as much as possible.
3075  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3076 */
3077 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3078 // *****************************************************************************
3079 /* Function:
3080  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3081  Summary:
3082  Reads the 16-bit Timer's counter register.
3083  <p><b>Implementation:</b> Dynamic</p>
3084  Description:
3085  This function returns the 16-bit Timer's value in the counter register. This
3086  is valid only if the 16-bit mode of the timer is selected.
3087  Otherwise use DRV_TMR_CounterValue32BitGet function.
3088  Precondition:
3089  The DRV_TMR_Initialize function must have been called. Must have selected
3090  16-Bit timer mode if mode selection is applicable.
3091  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3092  Parameters:
3093  handle - A valid open-instance handle, returned from the driver's
3094  open routine
3095 
3096  Returns:
3097  Timer period in 16-bit mode.
3098  Example:
3099  <code>
3100  //Example to use timer for precision time measurement
3101  //without configuring an alarm (interrupt based)
3102  char appState = 0;
3103  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3104 
3105  switch ( appState )
3106  {
3107  case 0:
3108  //Calculate and set the counter period
3109  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3110 
3111  //counter starts
3112  DRV_TMR_Start ( tmrHandle );
3113 
3114  //Trigger an application operation
3115  app_trigger_operation();
3116 
3117  //Check for time-out in the next state
3118  appState++;
3119  case 1:
3120  //Overflows and stops at 0 if no alarm is set
3121  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3122  {
3123  //Time-out
3124  return false;
3125  }
3126  else if ( app_operation_isComplete( ) )
3127  {
3128  //Operation is complete before time-out
3129  return true;
3130  }
3131  </code>
3132  Remarks:
3133  This function will be deprecated later, so avoid using it as much as possible.
3134  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3135 */
3136 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3137 // *****************************************************************************
3138 /* Function:
3139  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3140  Summary:
3141  Reads the 32-bit Timer's counter register.
3142  <p><b>Implementation:</b> Dynamic</p>
3143  Description:
3144  This function returns the 32-bit Timer's value in the counter register. This
3145  is valid only if the 32-bit mode of the timer is selected Otherwise use
3146  DRV_TMR_CounterValue16BitGet function.
3147  Precondition:
3148  The DRV_TMR_Initialize function must have been called. Must have selected
3149  32-Bit timer mode.
3150  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3151  Parameters:
3152  handle - A valid open-instance handle, returned from the driver's
3153  open routine
3154 
3155  Returns:
3156  32-Bit Counter value.
3157  Example:
3158  <code>
3159  //Example to use timer for precision time measurement
3160  //without configuring an alarm (interrupt based)
3161  char appState = 0;
3162  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3163 
3164  switch ( appState )
3165  {
3166  case 0:
3167  //Calculate and set the counter period
3168  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3169 
3170  //counter starts
3171  DRV_TMR_Start ( tmrHandle );
3172 
3173  //Trigger an application operation
3174  app_trigger_operation();
3175 
3176  //Check for time-out in the next state
3177  appState++;
3178  case 1:
3179  //Overflows and stops at 0 if no alarm is set
3180  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3181  {
3182  //Time-out
3183  return false;
3184  }
3185  else if ( app_operation_isComplete( ) )
3186  {
3187  //Operation is complete before time-out
3188  return true;
3189  }
3190  </code>
3191  Remarks:
3192  In most of the devices only even numbered instances of timer supports
3193  32-bit mode.
3194  This function will be deprecated later, so avoid using it as much as possible.
3195  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3196 */
3197 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3198 // *****************************************************************************
3199 /* Function:
3200  void DRV_TMR_Alarm16BitRegister
3201  (
3202  DRV_HANDLE handle,
3203  uint16_t period,
3204  bool isPeriodic,
3205  uintptr_t context,
3206  DRV_TMR_CALLBACK callBack
3207  )
3208  Summary:
3209  Sets up an alarm.
3210  <p><b>Implementation:</b> Dynamic</p>
3211  Description:
3212  This function sets up an alarm, allowing the client to receive a callback
3213  from the driver when the counter period elapses. Alarms can be one-shot or
3214  periodic. This API is valid only if the 16-bit mode of the timer is
3215  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3216  Precondition:
3217  The DRV_TMR_Initialize function must have been called. Must have selected
3218  16-Bit timer mode if mode selection is applicable.
3219  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3220  Parameters:
3221  handle - A valid handle, returned from DRV_TMR_Open
3222  period - 16-bit period which will be loaded into the Timer hardware register.
3223 
3224  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3225 
3226  context - A reference, call back function will be called with the same
3227  reference.
3228 
3229  callBack - A call back function which will be called on period elapse.
3230 
3231  Returns:
3232  None
3233  Example:
3234  <code>
3235  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3236 
3237  void setupTask ()
3238  {
3239  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3240 
3241  // Calculate the count to be passed on from the clock input
3242  //Periodically toggle LED
3243  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3244  ToggleLedCallBack );
3245  }
3246 
3247  void ToggleLedCallBack ( uintptr_t context )
3248  {
3249  //Toggle
3250  }
3251  </code>
3252  Remarks:
3253  This function will be deprecated later, so avoid using it as much as possible.
3254  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3255 */
3256 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3257 // *****************************************************************************
3258 /* Function:
3259  void DRV_TMR_Alarm32BitRegister
3260  (
3261  DRV_HANDLE handle,
3262  uint32_t period,
3263  bool isPeriodic,
3264  uintptr_t context,
3265  DRV_TMR_CALLBACK callBack
3266  )
3267  Summary:
3268  Sets up an alarm.
3269  <p><b>Implementation:</b> Dynamic</p>
3270  Description:
3271  This function sets up an alarm, allowing the client to receive a callback
3272  from the driver when the counter period elapses. Alarms can be one-shot or
3273  periodic. This API is valid only if the 32-bit mode of the timer is
3274  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3275  Precondition:
3276  The DRV_TMR_Initialize function must have been called. Must have selected
3277  32-Bit timer mode.
3278  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3279  Parameters:
3280  handle - A valid handle, returned from DRV_TMR_Open
3281  period - 32-bit period which will be loaded into the Timer hardware register.
3282 
3283  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3284 
3285  context - A reference, call back function will be called with the same
3286  reference.
3287 
3288  callBack - A call back function which will be called on period elapse.
3289 
3290  Returns:
3291  None
3292  Example:
3293  <code>
3294  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3295 
3296  void setupTask ()
3297  {
3298  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3299 
3300  // Calculate the count to be passed on from the clock input
3301  //Periodically toggle LED
3302  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3303  ToggleLedCallBack );
3304  }
3305 
3306  void ToggleLedCallBack ( uintptr_t context )
3307  {
3308  //Toggle
3309  }
3310  </code>
3311  Remarks:
3312  In most of the devices only even numbered instances of timer supports
3313  32-bit mode.
3314  This function will be deprecated later, so avoid using it as much as possible.
3315  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3316 */
3317 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3318 // *****************************************************************************
3319 /* Function:
3320  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3321  Summary:
3322  Updates the 16-bit Timer's period.
3323  <p><b>Implementation:</b> Dynamic</p>
3324  Description:
3325  This function updates the 16-bit Timer's period. This API is valid only if
3326  the 16-bit mode of the timer is selected
3327  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3328  Precondition:
3329  The DRV_TMR_Initialize function must have been called. Must have selected
3330  16-Bit timer mode if mode selection is applicable.
3331  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3332  Parameters:
3333  handle - A valid open-instance handle, returned from the driver's
3334  open routine
3335  value - 16-bit Period value
3336  Returns:
3337  None.
3338  Example:
3339  <code>
3340  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3341  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3342  </code>
3343  Remarks:
3344  This function will be deprecated later, so avoid using it as much as possible.
3345  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3346 */
3347 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3348 // *****************************************************************************
3349 /* Function:
3350  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3351  Summary:
3352  Updates the 32-bit Timer's period.
3353  <p><b>Implementation:</b> Dynamic</p>
3354  Description:
3355  This function updates the 32-bit Timer's period. This API is valid only if
3356  the 32-bit mode of the timer is selected
3357  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3358  Precondition:
3359  The DRV_TMR_Initialize unction must have been called. Must have selected
3360  32-Bit timer mode.
3361  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3362  Parameters:
3363  handle - A valid open-instance handle, returned from the driver's
3364  open routine
3365  period - 32-bit Period value
3366  Returns:
3367  None.
3368  Example:
3369  <code>
3370  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3371  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3372  </code>
3373  Remarks:
3374  In most of the devices only even numbered instances of timer supports
3375  32-bit mode.
3376  This function will be deprecated later, so avoid using it as much as possible.
3377  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3378 */
3379 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3380 // *****************************************************************************
3381 /* Function:
3382  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3383  Summary:
3384  Provides the 16-bit Timer's period.
3385  <p><b>Implementation:</b> Dynamic</p>
3386  Description:
3387  This function gets the 16-bit Timer's period. This API is valid only if
3388  the 16-bit mode of the timer is selected.
3389  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3390  Precondition:
3391  The DRV_TMR_Initialize function must have been called. Must have selected
3392  16-Bit timer mode if mode selection is applicable.
3393  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3394  Parameters:
3395  handle - A valid open-instance handle, returned from the driver's
3396  open routine
3397  Returns:
3398  16-bit timer period value
3399  Example:
3400  <code>
3401  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3402  uint16_t period;
3403 
3404  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3405  </code>
3406  Remarks:
3407  This function will be deprecated later, so avoid using it as much as possible.
3408  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3409 */
3410 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3411 // *****************************************************************************
3412 /* Function:
3413  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3414  Summary:
3415  Provides the 32-bit Timer's period.
3416  <p><b>Implementation:</b> Dynamic</p>
3417  Description:
3418  This function gets the 32-bit Timer's period. This API is valid only if
3419  the 32-bit mode of the timer is selected
3420  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3421  Precondition:
3422  The DRV_TMR_Initialize function must have been called. Must have selected
3423  32-Bit timer mode.
3424  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3425  Parameters:
3426  handle - A valid open-instance handle, returned from the driver's
3427  open routine
3428  Returns:
3429  32-bit Timer period value.
3430  Example:
3431  <code>
3432  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3433  uint32_t period;
3434  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3435  </code>
3436  Remarks:
3437  In most of the devices only even numbered instances of timer supports
3438  32-bit mode.
3439  This function will be deprecated later, so avoid using it as much as possible.
3440  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3441 */
3442 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3443 // *****************************************************************************
3444 /* Function:
3445  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3446  Summary:
3447  Removes a previously set alarm.
3448  <p><b>Implementation:</b> Dynamic</p>
3449  Description:
3450  This function removes a previously set alarm. This API is valid only if
3451  the 16-bit mode of the timer is selected
3452  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3453  Precondition:
3454  The DRV_TMR_Initialize function must have been called. Must have selected
3455  16-Bit timer mode if mode selection is applicable.
3456  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3457 
3458  DRV_TMR_Alarm16BitRegister function must have been called before.
3459  Parameters:
3460  handle - A valid open-instance handle, returned from the driver's
3461  open routine
3462  Returns:
3463  None.
3464  Example:
3465  <code>
3466  //Example of a key debounce check
3467 
3468  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3469  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3470  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3471 
3472  void keyPressDetect ()
3473  {
3474  // Calculate the count to be passed on from the clock input
3475  //Periodically toggle LED
3476  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3477  DebounceCheck );
3478  }
3479 
3480  void DebounceCheck ( uintptr_t context )
3481  {
3482  readKey = AppReadKey();
3483 
3484  if ( readKey != lastReadKey )
3485  {
3486  lastReadKey = readKey;
3487  keyCount = 0;
3488  }
3489  else
3490  {
3491  if ( keyCount > 20 )
3492  {
3493  globalKeyState = readKey;
3494  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3495  }
3496  keyCount++;
3497  }
3498  }
3499  </code>
3500  Remarks:
3501  This function will be deprecated later, so avoid using it as much as possible.
3502  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3503 */
3504 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3505 // *****************************************************************************
3506 /* Function:
3507  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3508  Summary:
3509  Removes a previously set alarm.
3510  <p><b>Implementation:</b> Dynamic</p>
3511  Description:
3512  This function removes a previously set alarm. This API is valid only if
3513  the 32-bit mode of the timer is selected
3514  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3515  Precondition:
3516  The DRV_TMR_Initialize function must have been called. Must have selected
3517  32-Bit timer mode if mode selection is applicable.
3518  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3519 
3520  DRV_TMR_Alarm32BitRegister function must have been called before.
3521  Parameters:
3522  handle - A valid open-instance handle, returned from the driver's
3523  open routine
3524  Returns:
3525  None.
3526  Example:
3527  <code>
3528  //Example of a key debounce check
3529 
3530  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3531  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3532  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3533 
3534  void keyPressDetect ( void )
3535  {
3536  // Calculate the count to be passed on from the clock input
3537  //Periodically check the key status
3538  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3539  DebounceCheck );
3540  }
3541 
3542  void DebounceCheck ( uintptr_t context )
3543  {
3544  readKey = AppReadKey();
3545 
3546  if ( readKey != lastReadKey )
3547  {
3548  lastReadKey = readKey;
3549  keyCount = 0;
3550  }
3551  else
3552  {
3553  if ( keyCount > 20 )
3554  {
3555  //Key is stable now
3556  globalKeyState = readKey;
3557  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3558  }
3559  keyCount++;
3560  }
3561  }
3562  </code>
3563  Remarks:
3564  In most of the devices only even numbered instances of timer supports
3565  32-bit mode.
3566  This function will be deprecated later, so avoid using it as much as possible.
3567  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3568 */
3569 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3570  // #ifndef _DRV_TMR_DEPRECATED_H
3571 /*******************************************************************************
3572  End of File
3573 */
3574 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3575 /* CLOSE_FILE Include File */
3576 
3577 //DOM-IGNORE-BEGIN
3578 //DOM-IGNORE-END
3579  // #ifndef _DRV_TMR_H
3580 /*******************************************************************************
3581  End of File
3582 */
3583 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3584 /* CLOSE_FILE Include File */
3585 
3586 #include "peripheral/tmr/plib_tmr.h"
3587 #include "peripheral/int/plib_int.h"
3588 // maximum divider value for 32 bit operation mode
3589 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3590 // minimum divider value for 32 bit operation mode
3591 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3592 // maximum divider value for 16 bit operation mode
3593 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3594 // minimum divider value for 16 bit operation mode
3595 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3596 // *****************************************************************************
3597 // *****************************************************************************
3598 // Section: Interface Headers for Instance 0 for the static driver
3599 // *****************************************************************************
3600 // *****************************************************************************
3601 
3602 void
3603  DRV_TMR0_Initialize ( void ) ;
3604 
3605 bool
3606  DRV_TMR0_Start ( void ) ;
3607 
3608 void
3609  DRV_TMR0_Stop ( void ) ;
3610 
3611 static inline void
3613  {
3614  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3615  DRV_TMR0_Stop () ;
3616  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3617  hvps_61zqendz ( 2 ) ; /* 30 */
3618  }
3619 
3620 static inline SYS_STATUS
3622 {
3623  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3624  /* Return the status as ready always */
3625  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3626  hvps_61zqendz ( 4 ) ; /* 30 */
3627  return
3628  SYS_STATUS_READY ;
3629 }
3630 
3631 static inline void
3632  DRV_TMR0_Open ( void )
3633  {
3634  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3635  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3636  hvps_61zqendz ( 6 ) ; /* 30 */
3637  }
3638 
3640  DRV_TMR0_ClientStatus ( void ) ;
3641 
3642 static inline DRV_TMR_OPERATION_MODE
3644 {
3645  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3646  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3647  hvps_61zqendz ( 8 ) ; /* 30 */
3648  return
3650 }
3651 
3652 static inline void
3654  {
3655  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3656  DRV_TMR0_Stop () ;
3657  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3658  hvps_61zqendz ( 10 ) ; /* 30 */
3659  }
3660 
3661 bool
3663  DRV_TMR_CLK_SOURCES clockSource ,
3664  TMR_PRESCALE prescale ) ;
3665 
3666 void
3668  uint32_t value ) ;
3669 
3670 uint32_t
3671  DRV_TMR0_CounterValueGet ( void ) ;
3672 
3673 void
3674  DRV_TMR0_CounterClear ( void ) ;
3675 
3676 TMR_PRESCALE
3677  DRV_TMR0_PrescalerGet ( void ) ;
3678 
3679 void
3681  uint32_t value ) ;
3682 
3683 uint32_t
3684  DRV_TMR0_PeriodValueGet ( void ) ;
3685 
3686 void
3687  DRV_TMR0_StopInIdleDisable ( void ) ;
3688 
3689 void
3690  DRV_TMR0_StopInIdleEnable ( void ) ;
3691 
3692 static inline void
3694  {
3695  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3696  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3697  hvps_61zqendz ( 12 ) ; /* 30 */
3698  }
3699 
3700 uint32_t
3701  DRV_TMR0_CounterFrequencyGet ( void ) ;
3702 
3705  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3706 // *****************************************************************************
3707 // *****************************************************************************
3708 // Section: Interface Headers for Instance 1 for the static driver
3709 // *****************************************************************************
3710 // *****************************************************************************
3711 
3712 void
3713  DRV_TMR1_Initialize ( void ) ;
3714 
3715 bool
3716  DRV_TMR1_Start ( void ) ;
3717 
3718 void
3719  DRV_TMR1_Stop ( void ) ;
3720 
3721 static inline void
3723  {
3724  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3725  DRV_TMR1_Stop () ;
3726  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3727  hvps_61zqendz ( 14 ) ; /* 30 */
3728  }
3729 
3730 static inline SYS_STATUS
3732 {
3733  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3734  /* Return the status as ready always */
3735  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3736  hvps_61zqendz ( 16 ) ; /* 30 */
3737  return
3738  SYS_STATUS_READY ;
3739 }
3740 
3741 static inline void
3742  DRV_TMR1_Open ( void )
3743  {
3744  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3745  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3746  hvps_61zqendz ( 18 ) ; /* 30 */
3747  }
3748 
3750  DRV_TMR1_ClientStatus ( void ) ;
3751 
3752 static inline DRV_TMR_OPERATION_MODE
3754 {
3755  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3756  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3757  hvps_61zqendz ( 20 ) ; /* 30 */
3758  return
3760 }
3761 
3762 static inline void
3764  {
3765  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3766  DRV_TMR1_Stop () ;
3767  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3768  hvps_61zqendz ( 22 ) ; /* 30 */
3769  }
3770 
3771 bool
3773  DRV_TMR_CLK_SOURCES clockSource ,
3774  TMR_PRESCALE prescale ) ;
3775 
3776 void
3778  uint32_t value ) ;
3779 
3780 uint32_t
3781  DRV_TMR1_CounterValueGet ( void ) ;
3782 
3783 void
3784  DRV_TMR1_CounterClear ( void ) ;
3785 
3786 TMR_PRESCALE
3787  DRV_TMR1_PrescalerGet ( void ) ;
3788 
3789 void
3791  uint32_t value ) ;
3792 
3793 uint32_t
3794  DRV_TMR1_PeriodValueGet ( void ) ;
3795 
3796 void
3797  DRV_TMR1_StopInIdleDisable ( void ) ;
3798 
3799 void
3800  DRV_TMR1_StopInIdleEnable ( void ) ;
3801 
3802 static inline void
3804  {
3805  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3806  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3807  hvps_61zqendz ( 24 ) ; /* 30 */
3808  }
3809 
3810 uint32_t
3811  DRV_TMR1_CounterFrequencyGet ( void ) ;
3812 
3815  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3816 // *****************************************************************************
3817 // *****************************************************************************
3818 // Section: Interface Headers for Instance 2 for the static driver
3819 // *****************************************************************************
3820 // *****************************************************************************
3821 
3822 void
3823  DRV_TMR2_Initialize ( void ) ;
3824 
3825 bool
3826  DRV_TMR2_Start ( void ) ;
3827 
3828 void
3829  DRV_TMR2_Stop ( void ) ;
3830 
3831 static inline void
3833  {
3834  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3835  DRV_TMR2_Stop () ;
3836  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3837  hvps_61zqendz ( 26 ) ; /* 30 */
3838  }
3839 
3840 static inline SYS_STATUS
3842 {
3843  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3844  /* Return the status as ready always */
3845  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3846  hvps_61zqendz ( 28 ) ; /* 30 */
3847  return
3848  SYS_STATUS_READY ;
3849 }
3850 
3851 static inline void
3852  DRV_TMR2_Open ( void )
3853  {
3854  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3855  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3856  hvps_61zqendz ( 30 ) ; /* 30 */
3857  }
3858 
3860  DRV_TMR2_ClientStatus ( void ) ;
3861 
3862 static inline DRV_TMR_OPERATION_MODE
3864 {
3865  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3866  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3867  hvps_61zqendz ( 32 ) ; /* 30 */
3868  return
3870 }
3871 
3872 static inline void
3874  {
3875  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3876  DRV_TMR2_Stop () ;
3877  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3878  hvps_61zqendz ( 34 ) ; /* 30 */
3879  }
3880 
3881 bool
3883  DRV_TMR_CLK_SOURCES clockSource ,
3884  TMR_PRESCALE prescale ) ;
3885 
3886 void
3888  uint32_t value ) ;
3889 
3890 uint32_t
3891  DRV_TMR2_CounterValueGet ( void ) ;
3892 
3893 void
3894  DRV_TMR2_CounterClear ( void ) ;
3895 
3896 TMR_PRESCALE
3897  DRV_TMR2_PrescalerGet ( void ) ;
3898 
3899 void
3901  uint32_t value ) ;
3902 
3903 uint32_t
3904  DRV_TMR2_PeriodValueGet ( void ) ;
3905 
3906 void
3907  DRV_TMR2_StopInIdleDisable ( void ) ;
3908 
3909 void
3910  DRV_TMR2_StopInIdleEnable ( void ) ;
3911 
3912 static inline void
3914  {
3915  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3916  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3917  hvps_61zqendz ( 36 ) ; /* 30 */
3918  }
3919 
3920 uint32_t
3921  DRV_TMR2_CounterFrequencyGet ( void ) ;
3922 
3925  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3926 // *****************************************************************************
3927 // *****************************************************************************
3928 // Section: Interface Headers for Instance 3 for the static driver
3929 // *****************************************************************************
3930 // *****************************************************************************
3931 
3932 void
3933  DRV_TMR3_Initialize ( void ) ;
3934 
3935 bool
3936  DRV_TMR3_Start ( void ) ;
3937 
3938 void
3939  DRV_TMR3_Stop ( void ) ;
3940 
3941 static inline void
3943  {
3944  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3945  DRV_TMR3_Stop () ;
3946  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3947  hvps_61zqendz ( 38 ) ; /* 30 */
3948  }
3949 
3950 static inline SYS_STATUS
3952 {
3953  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3954  /* Return the status as ready always */
3955  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3956  hvps_61zqendz ( 40 ) ; /* 30 */
3957  return
3958  SYS_STATUS_READY ;
3959 }
3960 
3961 static inline void
3962  DRV_TMR3_Open ( void )
3963  {
3964  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3965  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3966  hvps_61zqendz ( 42 ) ; /* 30 */
3967  }
3968 
3970  DRV_TMR3_ClientStatus ( void ) ;
3971 
3972 static inline DRV_TMR_OPERATION_MODE
3974 {
3975  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3976  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3977  hvps_61zqendz ( 44 ) ; /* 30 */
3978  return
3980 }
3981 
3982 static inline void
3984  {
3985  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3986  DRV_TMR3_Stop () ;
3987  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3988  hvps_61zqendz ( 46 ) ; /* 30 */
3989  }
3990 
3991 bool
3993  DRV_TMR_CLK_SOURCES clockSource ,
3994  TMR_PRESCALE prescale ) ;
3995 
3996 void
3998  uint32_t value ) ;
3999 
4000 uint32_t
4001  DRV_TMR3_CounterValueGet ( void ) ;
4002 
4003 void
4004  DRV_TMR3_CounterClear ( void ) ;
4005 
4006 TMR_PRESCALE
4007  DRV_TMR3_PrescalerGet ( void ) ;
4008 
4009 void
4011  uint32_t value ) ;
4012 
4013 uint32_t
4014  DRV_TMR3_PeriodValueGet ( void ) ;
4015 
4016 void
4017  DRV_TMR3_StopInIdleDisable ( void ) ;
4018 
4019 void
4020  DRV_TMR3_StopInIdleEnable ( void ) ;
4021 
4022 static inline void
4024  {
4025  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4026  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4027  hvps_61zqendz ( 48 ) ; /* 30 */
4028  }
4029 
4030 uint32_t
4031  DRV_TMR3_CounterFrequencyGet ( void ) ;
4032 
4035  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4036 // *****************************************************************************
4037 // *****************************************************************************
4038 // Section: Interface Headers for Instance 4 for the static driver
4039 // *****************************************************************************
4040 // *****************************************************************************
4041 
4042 void
4043  DRV_TMR4_Initialize ( void ) ;
4044 
4045 bool
4046  DRV_TMR4_Start ( void ) ;
4047 
4048 void
4049  DRV_TMR4_Stop ( void ) ;
4050 
4051 static inline void
4053  {
4054  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4055  DRV_TMR4_Stop () ;
4056  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4057  hvps_61zqendz ( 50 ) ; /* 30 */
4058  }
4059 
4060 static inline SYS_STATUS
4062 {
4063  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4064  /* Return the status as ready always */
4065  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4066  hvps_61zqendz ( 52 ) ; /* 30 */
4067  return
4068  SYS_STATUS_READY ;
4069 }
4070 
4071 static inline void
4072  DRV_TMR4_Open ( void )
4073  {
4074  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4075  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4076  hvps_61zqendz ( 54 ) ; /* 30 */
4077  }
4078 
4080  DRV_TMR4_ClientStatus ( void ) ;
4081 
4082 static inline DRV_TMR_OPERATION_MODE
4084 {
4085  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4086  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4087  hvps_61zqendz ( 56 ) ; /* 30 */
4088  return
4090 }
4091 
4092 static inline void
4094  {
4095  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4096  DRV_TMR4_Stop () ;
4097  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4098  hvps_61zqendz ( 58 ) ; /* 30 */
4099  }
4100 
4101 bool
4103  DRV_TMR_CLK_SOURCES clockSource ,
4104  TMR_PRESCALE prescale ) ;
4105 
4106 void
4108  uint32_t value ) ;
4109 
4110 uint32_t
4111  DRV_TMR4_CounterValueGet ( void ) ;
4112 
4113 void
4114  DRV_TMR4_CounterClear ( void ) ;
4115 
4116 TMR_PRESCALE
4117  DRV_TMR4_PrescalerGet ( void ) ;
4118 
4119 void
4121  uint32_t value ) ;
4122 
4123 uint32_t
4124  DRV_TMR4_PeriodValueGet ( void ) ;
4125 
4126 void
4127  DRV_TMR4_StopInIdleDisable ( void ) ;
4128 
4129 void
4130  DRV_TMR4_StopInIdleEnable ( void ) ;
4131 
4132 static inline void
4134  {
4135  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4136  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4137  hvps_61zqendz ( 60 ) ; /* 30 */
4138  }
4139 
4140 uint32_t
4141  DRV_TMR4_CounterFrequencyGet ( void ) ;
4142 
4145  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4146  // #ifndef _DRV_TMR_STATIC_H
4147 /*******************************************************************************
4148  End of File
4149 */
4150 
4151 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4152 /* CLOSE_FILE Include File */
4153 
4154 #include "peripheral/int/plib_int.h"
4155 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4156 /*******************************************************************************
4157  PMP Driver Interface Declarations for Static Single Instance Driver
4158  Company:
4159  Microchip Technology Inc.
4160  File Name:
4161  drv_pmp_static.h
4162  Summary:
4163  PMP driver interface declarations for the static single instance driver.
4164  Description:
4165  The PMP device driver provides a simple interface to manage the PMP
4166  modules on Microchip microcontrollers. This file defines the interface
4167  Declarations for the PMP driver.
4168 
4169  Remarks:
4170  Static interfaces incorporate the driver instance number within the names
4171  of the routines, eliminating the need for an object ID or object handle.
4172 
4173  Static single-open interfaces also eliminate the need for the open handle.
4174 *******************************************************************************/
4175 //DOM-IGNORE-BEGIN
4176 /*******************************************************************************
4177 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4178 Microchip licenses to you the right to use, modify, copy and distribute
4179 Software only when embedded on a Microchip microcontroller or digital signal
4180 controller that is integrated into your product or third party product
4181 (pursuant to the sublicense terms in the accompanying license agreement).
4182 You should refer to the license agreement accompanying this Software for
4183 additional information regarding your rights and obligations.
4184 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4185 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4186 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4187 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4188 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4189 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4190 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4191 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4192 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4193 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4194 *******************************************************************************/
4195 //DOM-IGNORE-END
4196 #ifndef _DRV_PMP_STATIC_H
4197 #define _DRV_PMP_STATIC_H
4198 #include "peripheral/pmp/plib_pmp.h"
4199 // *****************************************************************************
4200 // *****************************************************************************
4201 // Section: Interface Headers for Instance 0 for the static driver
4202 // *****************************************************************************
4203 // *****************************************************************************
4204 
4205 void
4206  DRV_PMP0_Initialize ( void ) ;
4207 
4208 void
4209  DRV_PMP0_ModeConfig ( void ) ;
4210 
4211 void
4213  PMP_DATA_WAIT_STATES dataWait ,
4214  PMP_STROBE_WAIT_STATES strobeWait ,
4215  PMP_DATA_HOLD_STATES dataHold ) ;
4216 
4217 uint8_t
4218  DRV_PMP0_Read ( void ) ;
4219 
4220 void
4221  DRV_PMP0_Write (
4222  uint8_t data ) ;
4223  // #ifndef _DRV_PMP_STATIC_H
4224 /*******************************************************************************
4225  End of File
4226 */
4227 
4228 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4229 /* CLOSE_FILE Include File */
4230 
4231 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4232 /*******************************************************************************
4233  USART Driver Interface Declarations for Static Single Instance Driver
4234  Company:
4235  Microchip Technology Inc.
4236  File Name:
4237  drv_usart_static.h
4238  Summary:
4239  USART driver interface declarations for the static single instance driver.
4240  Description:
4241  The USART device driver provides a simple interface to manage the USART
4242  modules on Microchip microcontrollers. This file defines the interface
4243  Declarations for the USART static driver.
4244  Remarks:
4245  Static interfaces incorporate the driver instance number within the names
4246  of the routines, eliminating the need for an object ID or object handle.
4247  Static single-open interfaces also eliminate the need for the open handle.
4248 *******************************************************************************/
4249 //DOM-IGNORE-BEGIN
4250 /*******************************************************************************
4251 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4252 Microchip licenses to you the right to use, modify, copy and distribute
4253 Software only when embedded on a Microchip microcontroller or digital signal
4254 controller that is integrated into your product or third party product
4255 (pursuant to the sublicense terms in the accompanying license agreement).
4256 You should refer to the license agreement accompanying this Software for
4257 additional information regarding your rights and obligations.
4258 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4259 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4260 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4261 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4262 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4263 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4264 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4265 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4266 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4267 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4268 *******************************************************************************/
4269 //DOM-IGNORE-END
4270 #ifndef _DRV_USART_STATIC_H
4271 #define _DRV_USART_STATIC_H
4272 // *****************************************************************************
4273 // *****************************************************************************
4274 // Section: Included Files
4275 // *****************************************************************************
4276 // *****************************************************************************
4277 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4278 /*******************************************************************************
4279  USART Driver Local Data Structures for static implementation
4280  Company:
4281  Microchip Technology Inc.
4282  File Name:
4283  drv_usart_static_local.h
4284  Summary:
4285  USART Driver Local Data Structures for static implementation
4286  Description:
4287  Driver Local Data Structures for static implementation
4288 *******************************************************************************/
4289 //DOM-IGNORE-BEGIN
4290 /*******************************************************************************
4291 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4292 Microchip licenses to you the right to use, modify, copy and distribute Software
4293 only when embedded on a Microchip microcontroller or digital signal controller
4294 that is integrated into your product or third party product (pursuant to the
4295 sublicense terms in the accompanying license agreement).
4296 You should refer to the license agreement accompanying this Software for
4297 additional information regarding your rights and obligations.
4298 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4299 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4300 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4301 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4302 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4303 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4304 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4305 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4306 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4307 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4308 *******************************************************************************/
4309 //DOM-IGNORE-END
4310 #ifndef _DRV_USART_STATIC_LOCAL_H
4311 #define _DRV_USART_STATIC_LOCAL_H
4312 // *****************************************************************************
4313 // *****************************************************************************
4314 // Section: Included Files
4315 // *****************************************************************************
4316 // *****************************************************************************
4317 #include <stdint.h>
4318 #include <stdbool.h>
4319 #include <stddef.h>
4320 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4321 /*******************************************************************************
4322  USART Driver Interface Header File
4323  Company:
4324  Microchip Technology Inc.
4325  File Name:
4326  drv_usart.h
4327  Summary:
4328  USART Driver Interface Header File
4329  Description:
4330  The USART device driver provides a simple interface to manage the USART or
4331  UART modules on Microchip microcontrollers. This file provides the
4332  interface definition for the USART driver.
4333 *******************************************************************************/
4334 //DOM-IGNORE-BEGIN
4335 /*******************************************************************************
4336 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4337 Microchip licenses to you the right to use, modify, copy and distribute
4338 Software only when embedded on a Microchip microcontroller or digital signal
4339 controller that is integrated into your product or third party product
4340 (pursuant to the sublicense terms in the accompanying license agreement).
4341 You should refer to the license agreement accompanying this Software for
4342 additional information regarding your rights and obligations.
4343 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4344 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4345 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4346 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4347 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4348 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4349 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4350 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4351 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4352 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4353 *******************************************************************************/
4354 //DOM-IGNORE-END
4355 #ifndef _DRV_USART_H
4356 #define _DRV_USART_H
4357 // *****************************************************************************
4358 // *****************************************************************************
4359 // Section: File includes
4360 // *****************************************************************************
4361 // *****************************************************************************
4362 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4363 /*******************************************************************************
4364  USART Driver Definitions Header File
4365  Company:
4366  Microchip Technology Inc.
4367  File Name:
4368  drv_usart_definitions.h
4369  Summary:
4370  USART Driver Definitions Header File
4371  Description:
4372  This file will provide enumerations and other dependencies needed by
4373  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4374 *******************************************************************************/
4375 //DOM-IGNORE-BEGIN
4376 /*******************************************************************************
4377 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4378 Microchip licenses to you the right to use, modify, copy and distribute
4379 Software only when embedded on a Microchip microcontroller or digital signal
4380 controller that is integrated into your product or third party product
4381 (pursuant to the sublicense terms in the accompanying license agreement).
4382 You should refer to the license agreement accompanying this Software for
4383 additional information regarding your rights and obligations.
4384 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4385 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4386 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4387 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4388 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4389 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4390 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4391 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4392 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4393 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4394 *******************************************************************************/
4395 //DOM-IGNORE-END
4396 #ifndef _DRV_USART_DEFINITIONS_H
4397 #define _DRV_USART_DEFINITIONS_H
4398 // *****************************************************************************
4399 // *****************************************************************************
4400 // Section: File includes
4401 // *****************************************************************************
4402 // *****************************************************************************
4403 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4404 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4405 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4406 /*******************************************************************************
4407  USART Peripheral Library Interface Header
4408  Company:
4409  Microchip Technology Inc.
4410  File Name:
4411  plib_usart.h
4412  Summary:
4413  USART Peripheral Library interface header.
4414  Description:
4415  This header file contains the function prototypes and definitions of
4416  the data types and constants that make up the interface to the USART
4417  Peripheral Library for all families of Microchip microcontrollers. The
4418  functions in this file are common to the USART module.
4419  *******************************************************************************/
4420 // DOM-IGNORE-BEGIN
4421 /*******************************************************************************
4422 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4423 Microchip licenses to you the right to use, modify, copy and distribute
4424 Software only when embedded on a Microchip microcontroller or digital signal
4425 controller that is integrated into your product or third party product
4426 (pursuant to the sublicense terms in the accompanying license agreement).
4427 You should refer to the license agreement accompanying this Software for
4428 additional information regarding your rights and obligations.
4429 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4430 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4431 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4432 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4433 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4434 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4435 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4436 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4437 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4438 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4439  *******************************************************************************/
4440 // DOM-IGNORE-END
4441 #ifndef _PLIB_USART_H
4442 #define _PLIB_USART_H
4443 // DOM-IGNORE-BEGIN
4444 // DOM-IGNORE-END
4445 // ****************************************************************************
4446 // ****************************************************************************
4447 // Section: Included Files
4448 // ****************************************************************************
4449 // ****************************************************************************
4450 /* This section lists the other files that are included in this file.
4451 */
4452 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4453 /*******************************************************************************
4454  Processor Selector File for the USART
4455  Company:
4456  Microchip Technology Incorporated
4457  File Name:
4458  processor.h
4459  Summary:
4460  Selects the appropriate header for the part family
4461  Description:
4462  This file selects the appropriate header for the part family
4463  *******************************************************************************/
4464 // DOM-IGNORE-BEGIN
4465 /*******************************************************************************
4466 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4467 Microchip licenses to you the right to use, modify, copy and distribute
4468 Software only when embedded on a Microchip microcontroller or digital signal
4469 controller that is integrated into your product or third party product
4470 (pursuant to the sublicense terms in the accompanying license agreement).
4471 You should refer to the license agreement accompanying this Software for
4472 additional information regarding your rights and obligations.
4473 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4474 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4475 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4476 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4477 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4478 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4479 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4480 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4481 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4482 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4483  *******************************************************************************/
4484 // DOM-IGNORE-END
4485 #ifndef _USART_PROCESSOR_H
4486 #define _USART_PROCESSOR_H
4487 // *****************************************************************************
4488 // *****************************************************************************
4489 // Section: Included Files
4490 // *****************************************************************************
4491 // *****************************************************************************
4492 /* This section lists the other files that are included in this file.
4493  */
4494 #include <stdint.h>
4495 #include <stdbool.h>
4496 #error "No Processor Family specified"
4497  //
4498  // _USART_PROCESSOR_H
4499 /*******************************************************************************
4500  End of File
4501  */
4502 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4503 /* CLOSE_FILE Include File */
4504 
4505 // ****************************************************************************
4506 // ****************************************************************************
4507 // Section: USART Peripheral Library Interface Functions
4508 // ****************************************************************************
4509 // ****************************************************************************
4510 //******************************************************************************
4511 /* Function:
4512  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4513  Summary:
4514  Enables the USART module to continue to operate when an overflow error
4515  condition has occurred.
4516  Description:
4517  This function enables the USART module to continue to operate when an
4518  overflow error condition has occurred.
4519  This operation is atomic.
4520  Precondition:
4521  None.
4522  Parameters:
4523  index - Identifier for the device instance to be configured
4524  Returns:
4525  None.
4526  Example:
4527  <code>
4528 #define MY_USART_INSTANCE USART_ID_1
4529  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4530  </code>
4531  Remarks:
4532  This feature may not be available on all devices. Please refer to the
4533  specific device data sheet to determine availability or use
4534  PLIB_USART_ExistsRunInOverflow in your application to determine
4535  whether this feature is available.
4536 */
4537 
4538 void
4540  USART_MODULE_ID index ) ;
4541 //******************************************************************************
4542 /* Function:
4543  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4544  Summary:
4545  Disables the Run in overflow condition mode.
4546  Description:
4547  This function disables the USART module from accepting new data when an overflow
4548  error condition is detected.
4549  This operation is atomic.
4550  Precondition:
4551  None.
4552  Parameters:
4553  index - Identifier for the device instance to be configured
4554  Returns:
4555  None.
4556  Example:
4557  <code>
4558 #define MY_USART_INSTANCE USART_ID_1
4559  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4560  </code>
4561  Remarks:
4562  This feature may not be available on all devices. Please refer to the
4563  specific device data sheet to determine availability or use
4564  PLIB_USART_ExistsRunInOverflow in your application to determine
4565  whether this feature is available.
4566 */
4567 
4568 void
4570  USART_MODULE_ID index ) ;
4571 //******************************************************************************
4572 /* Function:
4573  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4574  Summary:
4575  Gets the status of the Run in Overflow condition.
4576  Description:
4577  This function indicates if the USART module has been enabled to run in
4578  an overflow condition.
4579  This operation is atomic.
4580  Precondition:
4581  None.
4582  Parameters:
4583  index - Identifier for the device instance
4584  Returns:
4585  - true - Run in overflow condition is enabled
4586  - false - Run in overflow condition is disabled
4587  Example:
4588  <code>
4589 #define MY_USART_INSTANCE USART_ID_1
4590  bool status;
4591  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4592  </code>
4593  Remarks:
4594  This feature may not be available on all devices. Please refer to the
4595  specific device data sheet to determine availability or use
4596  PLIB_USART_ExistsRunInOverflow in your application to determine
4597  whether this feature is available.
4598 */
4599 
4600 bool
4602  USART_MODULE_ID index ) ;
4603 //******************************************************************************
4604 /* Function:
4605  void PLIB_USART_BRGClockSourceSelect
4606  (
4607  USART_MODULE_ID index,
4608  USART_BRG_CLOCK_SOURCE brgClockSource
4609  )
4610  Summary:
4611  Configures the BRG clock source of the USART module.
4612  Description:
4613  This function configures the BRG Clock source of the USART. Refer to
4614  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4615  Precondition:
4616  None.
4617  Parameters:
4618  index - Identifier for the device instance to be configured
4619  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4620  Returns:
4621  None.
4622  Example:
4623  <code>
4624 #define MY_USART_INSTANCE USART_ID_1
4625  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4626  </code>
4627  Remarks:
4628  This feature may not be available on all devices. Please refer to the
4629  specific device data sheet to determine availability or use
4630  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4631  whether this feature is available.
4632 */
4633 
4634 void
4636  USART_MODULE_ID index ,
4637  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4638 //******************************************************************************
4639 /* Function:
4640  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4641  Summary:
4642  Gets the BRG clock source of the USART module.
4643  Description:
4644  This function returns the BRG Clock source of the USART. Refer to
4645  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4646  This operation is atomic.
4647  Precondition:
4648  None.
4649  Parameters:
4650  index - Identifier for the device instance
4651  Returns:
4652  One of the possible values of USART_BRG_CLOCK_SOURCE
4653  Example:
4654  <code>
4655 #define MY_USART_INSTANCE USART_ID_1
4656  USART_BRG_CLOCK_SOURCE brgClockSource;
4657  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4658  </code>
4659  Remarks:
4660  This feature may not be available on all devices. Please refer to the
4661  specific device data sheet to determine availability or use
4662  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4663  whether this feature is available.
4664 */
4665 
4666 USART_BRG_CLOCK_SOURCE
4668  USART_MODULE_ID index ) ;
4669 //******************************************************************************
4670 /* Function:
4671  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4672  Summary:
4673  Returns the USART module's running status.
4674  Description:
4675  This function checks if the USART module status is busy. The following
4676  functions should not be used when the module status is busy:
4677  - PLIB_USART_LineControlModeSelect
4678  - PLIB_USART_BaudRateHighSet
4679  - PLIB_USART_BaudRateHighEnable
4680  - PLIB_USART_BaudRateHighDisable
4681  - PLIB_USART_ReceiverIdleStateLowEnable
4682  - PLIB_USART_ReceiverIdleStateLowDisable
4683  - PLIB_USART_BaudRateAutoDetectEnable
4684  - PLIB_USART_LoopbackEnable
4685  - PLIB_USART_LoopbackDisable
4686  - PLIB_USART_WakeOnStartEnable
4687  - PLIB_USART_WakeOnStartDisable
4688  - PLIB_USART_OperationModeSelect
4689  - PLIB_USART_HandshakeModeSelect
4690  - PLIB_USART_IrDAEnable
4691  - PLIB_USART_IrDADisable
4692  - PLIB_USART_StopInIdleEnable
4693  - PLIB_USART_StopInIdleDisable
4694  - PLIB_USART_RunInOverflowEnable
4695  - PLIB_USART_RunInOverflowDisable
4696  - PLIB_USART_BRGClockSourceSelect
4697  - PLIB_USART_RunInSleepModeEnable
4698  - PLIB_USART_RunInSleepModeDisable
4699  This operation is atomic.
4700  Precondition:
4701  None.
4702  Parameters:
4703  index - Identifier for the device instance
4704  Returns:
4705  - true - USART module is busy
4706  - false - USART module is idle
4707  Example:
4708  <code>
4709 #define MY_USART_INSTANCE USART_ID_1
4710  bool moduleStatus;
4711  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4712  </code>
4713  Remarks:
4714  This feature may not be available on all devices. Please refer to the
4715  specific device data sheet to determine availability or use
4716  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4717  whether this feature is available.
4718 */
4719 
4720 bool
4722  USART_MODULE_ID index ) ;
4723 //******************************************************************************
4724 /* Function:
4725  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4726  Summary:
4727  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4728  Description:
4729  This function enables the USART module's BRG clock to continue operation when
4730  the device enters the Sleep mode.
4731  This operation is atomic.
4732  Precondition:
4733  None.
4734  Parameters:
4735  index - Identifier for the device instance to be configured
4736  Returns:
4737  None.
4738  Example:
4739  <code>
4740 #define MY_USART_INSTANCE USART_ID_1
4741  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4742  </code>
4743  Remarks:
4744  This feature may not be available on all devices. Please refer to the
4745  specific device data sheet to determine availability or use
4746  PLIB_USART_ExistsRunInSleepMode in your application to determine
4747  whether this feature is available.
4748 */
4749 
4750 void
4752  USART_MODULE_ID index ) ;
4753 //******************************************************************************
4754 /* Function:
4755  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4756  Summary:
4757  Turns off the USART module's BRG clock during Sleep mode.
4758  Description:
4759  This function turns off the USART module's BRG clock during Sleep mode.
4760  This operation is atomic.
4761  Precondition:
4762  None.
4763  Parameters:
4764  index - Identifier for the device instance to be configured
4765  Returns:
4766  None.
4767  Example:
4768  <code>
4769 #define MY_USART_INSTANCE USART_ID_1
4770  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4771  </code>
4772  Remarks:
4773  This feature may not be available on all devices. Please refer to the
4774  specific device data sheet to determine availability or use
4775  PLIB_USART_ExistsRunInSleepMode in your application to determine
4776  whether this feature is available.
4777 */
4778 
4779 void
4781  USART_MODULE_ID index ) ;
4782 //******************************************************************************
4783 /* Function:
4784  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4785  Summary:
4786  Gets the status of Run in Sleep mode.
4787  Description:
4788  This function indicates if the USART module has been enabled to run in
4789  Sleep mode.
4790  This operation is atomic.
4791  Precondition:
4792  None.
4793  Parameters:
4794  index - Identifier for the device instance
4795  Returns:
4796  - true - Run in Sleep mode is enabled
4797  - false - Run in Sleep mode is disabled
4798  Example:
4799  <code>
4800 #define MY_USART_INSTANCE USART_ID_1
4801  bool status;
4802  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4803  </code>
4804  Remarks:
4805  This feature may not be available on all devices. Please refer to the
4806  specific device data sheet to determine availability or use
4807  PLIB_USART_ExistsRunInSleepMode in your application to determine
4808  whether this feature is available.
4809 */
4810 
4811 bool
4813  USART_MODULE_ID index ) ;
4814 //******************************************************************************
4815 /* Function:
4816  void PLIB_USART_Enable ( USART_MODULE_ID index )
4817  Summary:
4818  Enables the specific USART module.
4819  Description:
4820  This function enables the specific USART module.
4821  This operation is atomic.
4822  Precondition:
4823  None.
4824  Parameters:
4825  index - Identifier for the device instance to be configured
4826  Returns:
4827  None.
4828  Example:
4829  <code>
4830 #define MY_USART_INSTANCE USART_ID_1
4831  PLIB_USART_Enable(MY_USART_INSTANCE);
4832  </code>
4833  Remarks:
4834  By calling this function, the USART pins are controlled by the USART
4835  module.
4836  This feature may not be available on all devices. Please refer to the
4837  specific device data sheet to determine availability or use
4838  PLIB_USART_ExistsEnable in your application to determine whether
4839  this feature is available.
4840 */
4841 
4842 void
4844  USART_MODULE_ID index ) ;
4845 //******************************************************************************
4846 /* Function:
4847  void PLIB_USART_Disable ( USART_MODULE_ID index )
4848  Summary:
4849  Disables the specific USART module
4850  Description:
4851  This function disables the specific USART module.
4852  This operation is atomic.
4853  Precondition:
4854  None.
4855  Parameters:
4856  index - Identifier for the device instance to be configured
4857  Returns:
4858  None.
4859  Example:
4860  <code>
4861 #define MY_USART_INSTANCE USART_ID_1
4862  PLIB_USART_Disable(MY_USART_INSTANCE);
4863  </code>
4864  Remarks:
4865  The default state after any reset for a USART module is the disable state.
4866  If the USART is disabled, all of the related pins are in control of the
4867  general purpose I/O logic.
4868 
4869  Disabling the USART module resets the buffers to empty states. Any data
4870  characters in the buffers are lost and the baud rate is reset. All error
4871  and status bits are also reset.
4872 
4873  Disabling the USART while the USART is active, will abort all pending
4874  transmissions and receptions. Re-enabling the USART will restart the
4875  module in the same configuration.
4876 
4877  When disabled, the USART power consumption is minimal.
4878  This feature may not be available on all devices. Please refer to the
4879  specific device data sheet to determine availability or use
4880  PLIB_USART_ExistsEnable in your application to determine whether
4881  this feature is available.
4882 */
4883 
4884 void
4886  USART_MODULE_ID index ) ;
4887 //******************************************************************************
4888 /* Function:
4889  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4890  Summary:
4891  Enables the specific USART module transmitter.
4892  Description:
4893  This function enables the specific USART module transmitter.
4894  This operation is atomic.
4895  Precondition:
4896  The USART module should be enabled using the function PLIB_USART_Enable
4897  before this function is called.
4898  Parameters:
4899  index - Identifier for the device instance to be configured
4900  Returns:
4901  None.
4902  Example:
4903  <code>
4904 #define MY_USART_INSTANCE USART_ID_1
4905  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4906  </code>
4907  Remarks:
4908  The transmitter should not be enabled until the USART is enabled.
4909  The transmissions will not be enabled otherwise.
4910 
4911  This feature may not be available on all devices. Please refer to the
4912  specific device data sheet to determine availability or use
4913  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4914  this feature is available.
4915 */
4916 
4917 void
4919  USART_MODULE_ID index ) ;
4920 //******************************************************************************
4921 /* Function:
4922  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4923  Summary:
4924  Disables the specific USART module transmitter.
4925  Description:
4926  This function disables the specific USART module transmitter.
4927  This operation is atomic.
4928  Precondition:
4929  None.
4930  Parameters:
4931  index - Identifier for the device instance to be configured
4932  Returns:
4933  None.
4934  Example:
4935  <code>
4936 #define MY_USART_INSTANCE USART_ID_1
4937  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4938  </code>
4939  Remarks:
4940  Disabling the transmitter during a transmission will cause the
4941  transmission to be aborted.
4942 
4943  This feature may not be available on all devices. Please refer to the
4944  specific device data sheet to determine availability or use
4945  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4946  this feature is available.
4947 */
4948 
4949 void
4951  USART_MODULE_ID index ) ;
4952 //******************************************************************************
4953 /* Function:
4954  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4955  uint32_t baudRate );
4956  Summary:
4957  Sets the baud rate to the desired value.
4958  Description:
4959  This function sets the baud rate to the desired value.
4960  Precondition:
4961  None.
4962  Parameters:
4963  index - Identifier for the device instance to be configured
4964  baudRate - Baud Rate Value
4965  clockFrequency - Clock Frequency
4966  Returns:
4967  None.
4968  Example:
4969  <code>
4970 #define MY_USART_INSTANCE USART_ID_1
4971  uint32_t baudRateValue ;
4972  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4973  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4974  </code>
4975  Remarks:
4976  Setting a new baud rate value causes the baud rate timer to reset.
4977  This ensures that the baud rate timer does not have to overflow before
4978  outputting the new baud rate.
4979 
4980  If the system clock is changed during an active receive operation, a
4981  receiver error or data loss may result. To avoid this issue verify that
4982  no receptions are in progress before changing the system clock.
4983 
4984  This feature may not be available on all devices. Please refer to the
4985  specific device data sheet to determine availability or use
4986  PLIB_USART_ExistsBaudRate in your application to determine whether
4987  this feature is available.
4988 */
4989 
4990 void
4992  USART_MODULE_ID index ,
4993  uint32_t clockFrequency ,
4994  uint32_t baudRate ) ;
4995 //******************************************************************************
4996 /* Function:
4997  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
4998  uint32_t clockFrequency, uint32_t baudRate );
4999  Summary:
5000  Sets the baud rate to the desired value.
5001  Description:
5002  This function sets the baud rate to the desired value.
5003  Precondition:
5004  None.
5005  Parameters:
5006  index - Identifier for the device instance to be configured
5007  baudRate - Baud Rate Value, it is the baud rate value
5008  clockFrequency - Clock Frequency
5009  Returns:
5010  None.
5011  Example:
5012  <code>
5013 #define MY_USART_INSTANCE USART_ID_1
5014  uint32_t baudRateValue ;
5015  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5016  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5017  </code>
5018  Remarks:
5019  Setting a new baud rate value causes the baud rate timer to reset.
5020  This ensures that the baud rate timer does not have to overflow before
5021  outputting the new baud rate.
5022 
5023  If the system clock is changed during an active receive operation, a
5024  receiver error or data loss may result. To avoid this issue verify that
5025  no receptions are in progress before changing the system clock.
5026 
5027  This feature may not be available on all devices. Please refer to the
5028  specific device data sheet to determine availability or use
5029  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5030  this feature is available.
5031 */
5032 
5033 void
5035  USART_MODULE_ID index ,
5036  uint32_t clockFrequency ,
5037  uint32_t baudRate ) ;
5038 //******************************************************************************
5039 /* Function:
5040  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5041  int32_t clockFrequency );
5042  Summary:
5043  Gets the baud rate current in use.
5044  Description:
5045  This function gets the baud rate that is currently in use. The clock frequency
5046  needs to be passed to the function.
5047  Conditions:
5048  None.
5049  Input:
5050  index - Identifier for the device instance to be configured
5051  clockFrequency - Clock Frequency
5052  Returns:
5053  - BaudRate - Baud rate value
5054  Example:
5055  <code>
5056 #define MY_USART_INSTANCE USART_ID_1
5057  uint32_t baudRate ;
5058  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5059  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5060  </code>
5061  Remarks:
5062  This feature may not be available on all devices. Please refer to the
5063  specific device data sheet to determine availability or use
5064  PLIB_USART_ExistsBaudRate in your application to determine whether
5065  this feature is available.
5066 */
5067 
5068 uint32_t
5070  USART_MODULE_ID index ,
5071  int32_t clockFrequency ) ;
5072 //******************************************************************************
5073 /* Function:
5074  void PLIB_USART_AddressSet
5075  (
5076  USART_MODULE_ID index,
5077  uint8_t address
5078  )
5079  Summary:
5080  Sets the address for the Address Detect mode.
5081  Description:
5082  This function sets the address for the Address Detect mode.
5083  This operation is atomic.
5084  Precondition:
5085  None.
5086  Parameters:
5087  index - Identifier for the device instance to be configured
5088  address - Address
5089  Returns:
5090  None.
5091  Example:
5092  <code>
5093 #define MY_USART_INSTANCE USART_ID_1
5094  uint8_t address = 0x02;
5095  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5096  </code>
5097  Remarks:
5098  This feature may not be available on all devices. Please refer to the
5099  specific device data sheet to determine availability or use
5100  PLIB_USART_ExistsReceiverAddress in your application to determine
5101  whether this feature is available.
5102 */
5103 
5104 void
5106  USART_MODULE_ID index ,
5107  uint8_t address ) ;
5108 //******************************************************************************
5109 /* Function:
5110  uint8_t PLIB_USART_AddressGet
5111  (
5112  USART_MODULE_ID index
5113  )
5114  Summary:
5115  Gets the address for the Address Detect mode.
5116  Description:
5117  This function returns the address value being used for the Address
5118  Detect mode.
5119  This operation is atomic.
5120  Precondition:
5121  None.
5122  Parameters:
5123  index - Identifier for the device instance
5124  Returns:
5125  - address - The address being used
5126  Example:
5127  <code>
5128 #define MY_USART_INSTANCE USART_ID_1
5129  uint8_t address = 0;
5130  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5131  </code>
5132  Remarks:
5133  This feature may not be available on all devices. Please refer to the
5134  specific device data sheet to determine availability or use
5135  PLIB_USART_ExistsReceiverAddress in your application to determine
5136  whether this feature is available.
5137 */
5138 
5139 uint8_t
5141  USART_MODULE_ID index ) ;
5142 //******************************************************************************
5143 /* Function:
5144  void PLIB_USART_AddressMaskSet
5145  (
5146  USART_MODULE_ID index,
5147  uint8_t mask
5148  )
5149  Summary:
5150  Sets the address mask for the Address Detect mode.
5151  Description:
5152  This function sets the address mask for the Address Detect mode.
5153  This operation is atomic.
5154  Precondition:
5155  None.
5156  Parameters:
5157  index - Identifier for the device instance to be configured
5158  mask - Address match mask bits
5159  Returns:
5160  None.
5161  Example:
5162  <code>
5163 #define MY_USART_INSTANCE USART_ID_1
5164  uint8_t mask = 0x0F;
5165  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5166  </code>
5167  Remarks:
5168  This feature may not be available on all devices. Please refer to the
5169  specific device data sheet to determine availability or use
5170  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5171  whether this feature is available.
5172 */
5173 
5174 void
5176  USART_MODULE_ID index ,
5177  uint8_t mask ) ;
5178 //******************************************************************************
5179 /* Function:
5180  uint8_t PLIB_USART_AddressMaskGet
5181  (
5182  USART_MODULE_ID index
5183  )
5184  Summary:
5185  Gets the address mask for the Address Detect mode.
5186  Description:
5187  This function returns the address mask value being used for the Address
5188  Detect mode.
5189  This operation is atomic.
5190  Precondition:
5191  None.
5192  Parameters:
5193  index - Identifier for the device instance to be configured
5194  Returns:
5195  - mask - Address mask being used
5196  Example:
5197  <code>
5198 #define MY_USART_INSTANCE USART_ID_1
5199  uint8_t mask = 0;
5200  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5201  </code>
5202  Remarks:
5203  This feature may not be available on all devices. Please refer to the
5204  specific device data sheet to determine availability or use
5205  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5206  whether this feature is available.
5207 */
5208 
5209 uint8_t
5211  USART_MODULE_ID index ) ;
5212 //******************************************************************************
5213 /* Function:
5214  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5215  Summary:
5216  Enables the Address Detect mode.
5217  Description:
5218  This function enables the Address Detect mode. If it is enabled, and the
5219  device is addressed, disable the Address Detect mode to continue receiving
5220  bytes.
5221  This operation is atomic.
5222  Precondition:
5223  None.
5224  Parameters:
5225  index - Identifier for the device instance to be configured
5226  Returns:
5227  None.
5228  Example:
5229  <code>
5230 #define MY_USART_INSTANCE USART_ID_1
5231  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5232  </code>
5233  Remarks:
5234  If 9 data bits are not selected, this bit has no effect.
5235  This feature may not be available on all devices. Please refer to the
5236  specific device data sheet to determine availability or use
5237  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5238  this feature is available.
5239 */
5240 
5241 void
5243  USART_MODULE_ID index ) ;
5244 //******************************************************************************
5245 /* Function:
5246  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5247  Summary:
5248  Enables the Address Detect mode.
5249  Description:
5250  This function disables the Address Detect mode. If it is enabled, and the
5251  device is addressed, disable the Address Detect mode to continue receiving
5252  bytes.
5253  This operation is atomic.
5254  Precondition:
5255  None.
5256  Parameters:
5257  index - Identifier for the device instance to be configured
5258  Returns:
5259  None.
5260  Example:
5261  <code>
5262 #define MY_USART_INSTANCE USART_ID_1
5263  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5264  </code>
5265  Remarks:
5266  All bytes are received, and the 9th bit can be used as the parity bit.
5267  By default, the address detect is disabled.
5268 
5269  This feature may not be available on all devices. Please refer to the
5270  specific device data sheet to determine availability or use
5271  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5272  this feature is available.
5273 */
5274 
5275 void
5277  USART_MODULE_ID index ) ;
5278 //******************************************************************************
5279 /* Function:
5280  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5281  Summary:
5282  Gets the state of the automatic baud detection.
5283  Description:
5284  This function gets the state of the automatic baud detection and returns a '0'
5285  if the baud rate auto detection is complete.
5286  This operation is atomic.
5287  Precondition:
5288  None.
5289  Parameters:
5290  index - Identifier for the device instance to be configured
5291  Returns:
5292  - true - Baud rate detection is not complete
5293  - false - Baud rate detection is complete
5294  Example:
5295  <code>
5296 #define MY_USART_INSTANCE USART_ID_1
5297  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5298  // Wait until the baud rate is detected.
5299  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5300  </code>
5301  Remarks:
5302  This feature may not be available on all devices. Please refer to the
5303  specific device data sheet to determine availability or use
5304  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5305  this feature is available.
5306 */
5307 
5308 bool
5310  USART_MODULE_ID index ) ;
5311 //******************************************************************************
5312 /* Function:
5313  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5314  Summary:
5315  Enables baud rate measurement on the next character, which requires reception
5316  of the Sync character.
5317  Description:
5318  This function enables the baud rate measurement on the next character,
5319  which requires reception of the Sync character.
5320  This operation is atomic.
5321  Precondition:
5322  None.
5323  Parameters:
5324  index - Identifier for the device instance to be configured
5325  Returns:
5326  None.
5327  Example:
5328  <code>
5329 #define MY_USART_INSTANCE USART_ID_1
5330  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5331  // Wait until the baud rate is detected.
5332  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5333  </code>
5334  Remarks:
5335  This feature may not be available on all devices. Please refer to the
5336  specific device data sheet to determine availability or use
5337  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5338  this feature is available.
5339 */
5340 
5341 void
5343  USART_MODULE_ID index ) ;
5344 //******************************************************************************
5345 /* Function:
5346  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5347  Summary:
5348  Data to be transmitted in the Byte mode.
5349  Description:
5350  The data is transmitted in the Byte mode for the specified USART module.
5351  This operation is atomic.
5352  Precondition:
5353  None.
5354  Parameters:
5355  index - Identifier for the device instance to be configured
5356  data - Data to be transmitted.
5357  Returns:
5358  None.
5359  Example:
5360  <code>
5361 #define MY_USART_INSTANCE USART_ID_1
5362  uint8_t data = 'a';
5363  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5364  {
5365  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5366  }
5367  </code>
5368  Remarks:
5369  This feature may not be available on all devices. Please refer to the
5370  specific device data sheet to determine availability or use
5371  PLIB_USART_ExistsTransmitter in your application to determine whether
5372  this feature is available.
5373 */
5374 
5375 void
5377  USART_MODULE_ID index ,
5378  int8_t data ) ;
5379 //******************************************************************************
5380 /* Function:
5381  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5382  Summary:
5383  Data to be received in the Byte mode.
5384  Description:
5385  The data to be received in Byte mode from the specified USART module.
5386  This operation is atomic.
5387  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5388  PLIB_USART_ReceiverParityErrorHasOccurred and
5389  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5390  Precondition:
5391  None.
5392  Parameters:
5393  index - Identifier for the device instance to be configured
5394  Returns:
5395  - data - Data to be received
5396  Example:
5397  <code>
5398 #define MY_USART_INSTANCE USART_ID_1
5399  bool isError;
5400  uint8_t mydata;
5401  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5402  {
5403  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5404  }
5405  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5406  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5407  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5408  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5409  {
5410  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5411  }
5412  </code>
5413  Remarks:
5414  This feature may not be available on all devices. Please refer to the
5415  specific device data sheet to determine availability or use
5416  PLIB_USART_ExistsReceiver in your application to determine whether
5417  this feature is available.
5418 */
5419 
5420 int8_t
5422  USART_MODULE_ID index ) ;
5423 //******************************************************************************
5424 /* Function:
5425  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5426  Summary:
5427  Data to be received in the byte mode with the 9th bit.
5428  Description:
5429  The data to be received in Byte mode from the specified USART module.
5430  with the 9th bit.
5431  This operation is atomic.
5432  Precondition:
5433  None.
5434  Parameters:
5435  index - Identifier for the device instance to be configured
5436  Returns:
5437  - data - Data to be received
5438  Example:
5439  <code>
5440 #define MY_USART_INSTANCE USART_ID_1
5441  uint16_t mydata;
5442  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5443  {
5444  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5445  }
5446  </code>
5447  Remarks:
5448  This feature may not be available on all devices. Please refer to the
5449  specific device data sheet to determine availability or use
5450  PLIB_USART_ExistsReceiver9Bits in your application to determine
5451  whether this feature is available.
5452 */
5453 
5454 int16_t
5456  USART_MODULE_ID index ) ;
5457 //******************************************************************************
5458 /* Function:
5459  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5460  Summary:
5461  Checks and return if the data received is an address.
5462  Description:
5463  Checks and return if the data received is an address. The address has
5464  the 9th bit set. If data received has the 9th bit set, the function returns true;
5465  otherwise, the function returns false.
5466  This operation is atomic.
5467  Precondition:
5468  The USART module should be configured to use the 9 data bits.
5469  Parameters:
5470  index - Identifier for the device instance to be configured
5471  Returns:
5472  - true - if the data received has the 9th bit set
5473  - false - if the address received has the 9th bit cleared
5474  Example:
5475  <code>
5476 #define MY_USART_INSTANCE USART_ID_1
5477  int8_t address;
5478  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5479  {
5480  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5481  }
5482  </code>
5483  Remarks:
5484  This feature may not be available on all devices. Please refer to the
5485  specific device data sheet to determine availability or use
5486  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5487  this feature is available.
5488 */
5489 
5490 bool
5492  USART_MODULE_ID index ) ;
5493 //******************************************************************************
5494 /* Function:
5495  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5496  int8_t data, bool 9thBit )
5497  Summary:
5498  Data to be transmitted in the byte mode with the 9th bit.
5499  Description:
5500  The data is transmitted in the byte mode for the specified USART module,
5501  with 9th bit.
5502  This operation is atomic.
5503  Precondition:
5504  The USART module should be configured to use the 9 data bits.
5505  Parameters:
5506  index - Identifier for the device instance to be configured
5507  data - Data to be transmitted.
5508  9thBit - 9th bit of the data to be transmitted.
5509  Returns:
5510  None.
5511  Example:
5512  <code>
5513 #define MY_USART_INSTANCE USART_ID_1
5514  uint8_t data = 'a';
5515  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5516  {
5517  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5518  }
5519  </code>
5520  Remarks:
5521  This feature may not be available on all devices. Please refer to the
5522  specific device data sheet to determine availability or use
5523  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5524  this feature is available.
5525 */
5526 
5527 void
5529  USART_MODULE_ID index ,
5530  int8_t data ,
5531  bool Bit9th ) ;
5532 //******************************************************************************
5533 /* Function:
5534  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5535  Summary:
5536  Transmits the break character.
5537  Description:
5538  This function transmits the break character.
5539  This operation is atomic.
5540  Precondition:
5541  The application should wait for the transmitter to be idle, before calling
5542  this function.
5543  Parameters:
5544  index - Identifier for the device instance to be configured
5545  Returns:
5546  None.
5547  Example:
5548  <code>
5549 #define MY_USART_INSTANCE USART_ID_1
5550  // Wait for the Transmit buffer to be empty.
5551  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5552  // Transmit the break character.
5553  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5554  // wait for the break transmission to complete
5555  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5556  </code>
5557  Remarks:
5558  After the break has been transmitted, the application can start
5559  transmitting next bytes.
5560 
5561  This feature may not be available on all devices. Please refer to the
5562  specific device data sheet to determine availability or use
5563  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5564  this feature is available.
5565 */
5566 
5567 void
5569  USART_MODULE_ID index ) ;
5570 //******************************************************************************
5571 /* Function:
5572  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5573  Summary:
5574  Returns the status of the break transmission
5575  Description:
5576  The function returns the status of the break transmission.
5577  This operation is atomic.
5578  Precondition:
5579  None.
5580  Parameters:
5581  index - Identifier for the device instance to be configured
5582  Returns:
5583  - true - Transmit break on the next transmission
5584  - false - Break transmission completed or not started
5585  Example:
5586  <code>
5587 #define MY_USART_INSTANCE USART_ID_1
5588  // Wait for the Transmit buffer to be empty.
5589  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5590  // Transmit the break character.
5591  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5592  // wait for the break transmission to complete
5593  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5594  </code>
5595  Remarks:
5596  After the break has been transmitted, the application can start
5597  transmitting next bytes.
5598 
5599  This feature may not be available on all devices. Please refer to the
5600  specific device data sheet to determine availability or use
5601  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5602  this feature is available.
5603 */
5604 
5605 bool
5607  USART_MODULE_ID index ) ;
5608 //******************************************************************************
5609 /* Function:
5610  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5611  Summary:
5612  Identifies if the receive data is available for the specified USART module.
5613  Description:
5614  This function identifies if the receive data is available for the specified
5615  USART module.
5616  This operation is atomic.
5617  Precondition:
5618  None.
5619  Parameters:
5620  index - Identifier for the device instance to be configured
5621  Returns:
5622  - true - The data is available
5623  - false - The data is not available
5624  Example:
5625  <code>
5626 #define MY_USART_INSTANCE USART_ID_1
5627  int8_t mydata;
5628  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5629  {
5630  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5631  }
5632  </code>
5633  Remarks:
5634  This feature may not be available on all devices. Please refer to the
5635  specific device data sheet to determine availability or use
5636  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5637  whether this feature is available.
5638 */
5639 
5640 bool
5642  USART_MODULE_ID index ) ;
5643 //******************************************************************************
5644 /* Function:
5645  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5646  Summary:
5647  Clears a USART vverrun error.
5648  Description:
5649  This function clears an overrun error. Clearing the error, resets the receive buffer.
5650  This operation is atomic.
5651  Precondition:
5652  None.
5653  Parameters:
5654  index - Identifier for the device instance to be configured
5655  Returns:
5656  None.
5657  Example:
5658  <code>
5659 #define MY_USART_INSTANCE USART_ID_1
5660  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5661  {
5662  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5663  }
5664  </code>
5665  Remarks:
5666  WARNING: Calling this API will clear all of the previously received data.
5667 
5668  This feature may not be available on all devices. Please refer to the
5669  specific device data sheet to determine availability or use
5670  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5671  whether this feature is available.
5672 */
5673 
5674 void
5676  USART_MODULE_ID index ) ;
5677 //******************************************************************************
5678 /* Function:
5679  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5680  Summary:
5681  Gets the transmit buffer full status.
5682  Description:
5683  This function gets the transmit status of the specified USART module.
5684  This operation is atomic.
5685  Precondition:
5686  None.
5687  Parameters:
5688  index - Identifier for the device instance to be configured
5689  Returns:
5690  - true - The transmit buffer is full
5691  - false - The transmit buffer is not full, at least one more
5692  character can be written
5693  Example:
5694  <code>
5695 #define MY_USART_INSTANCE USART_ID_1
5696  // Wait for the Transmit buffer to be empty.
5697  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5698  // Transmit the break character.
5699  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5700  </code>
5701  Remarks:
5702  This feature may not be available on all devices. Please refer to the
5703  specific device data sheet to determine availability or use
5704  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5705  whether this feature is available.
5706 */
5707 
5708 bool
5710  USART_MODULE_ID index ) ;
5711 //******************************************************************************
5712 /* Function:
5713  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5714  Summary:
5715  Gets the transmit shift register empty status.
5716  Description:
5717  This function gets the transmit shift register empty status.
5718  This operation is atomic.
5719  Precondition:
5720  None.
5721  Parameters:
5722  index - Identifier for the device instance to be configured
5723  Returns:
5724  - true - The transmit shift register is empty
5725  - false - The transmit shift register is not empty
5726  Example:
5727  <code>
5728 #define MY_USART_INSTANCE USART_ID_1
5729  // Wait for the Transmit buffer to be empty.
5730  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5731  // Transmit the break character.
5732  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5733  </code>
5734  Remarks:
5735  This feature may not be available on all devices. Please refer to the
5736  specific device data sheet to determine availability or use
5737  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5738  whether this feature is available.
5739 */
5740 
5741 bool
5743  USART_MODULE_ID index ) ;
5744 //******************************************************************************
5745 /* Function:
5746  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5747  Summary:
5748  Gets the framing error status.
5749  Description:
5750  This function gets the framing error status.
5751  This operation is atomic.
5752  Precondition:
5753  None.
5754  Parameters:
5755  index - Identifier for the device instance to be configured
5756  Returns:
5757  - true - The framing error was detected on the current character
5758  - false - The framing error was not detected on the current
5759  character
5760  Example:
5761  <code>
5762 #define MY_USART_INSTANCE USART_ID_1
5763  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5764  </code>
5765  Remarks:
5766  Reading the error clears the error.
5767  This feature may not be available on all devices. Please refer to the
5768  specific device data sheet to determine availability or use
5769  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5770  whether this feature is available.
5771 */
5772 
5773 bool
5775  USART_MODULE_ID index ) ;
5776 //******************************************************************************
5777 /* Function:
5778  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5779  Summary:
5780  Gets the parity error status.
5781  Description:
5782  This function gets the parity error status.
5783  This operation is atomic.
5784  Precondition:
5785  None.
5786  Parameters:
5787  index - Identifier for the device instance to be configured
5788  Returns:
5789  - true - The parity error was detected on the current character
5790  - false - The parity error was not detected on the current character
5791  Example:
5792  <code>
5793 #define MY_USART_INSTANCE USART_ID_1
5794  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5795  </code>
5796  Remarks:
5797  Reading the error clears the error.
5798  A Parity error is irrelevant in case of 9-bit mode.
5799  This feature may not be available on all devices. Please refer to the
5800  specific device data sheet to determine availability or use
5801  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5802  whether this feature is available.
5803 */
5804 
5805 bool
5807  USART_MODULE_ID index ) ;
5808 //******************************************************************************
5809 /* Function:
5810  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5811  Summary:
5812  Identifies if there was a receiver overrun error.
5813  Description:
5814  This function identifies if there was a receiver overrun error.
5815  This operation is atomic.
5816  Precondition:
5817  None.
5818  Parameters:
5819  index - Identifier for the device instance to be configured
5820  Returns:
5821  - true - The receive buffer has overflowed
5822  - false - The receive buffer has not overflowed
5823  Example:
5824  <code>
5825 #define MY_USART_INSTANCE USART_ID_1
5826  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5827  {
5828  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5829  }
5830  </code>
5831  Remarks:
5832  This feature may not be available on all devices. Please refer to the
5833  specific device data sheet to determine availability or use
5834  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5835  whether this feature is available.
5836 */
5837 
5838 bool
5840  USART_MODULE_ID index ) ;
5841 //******************************************************************************
5842 /* Function:
5843  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5844  Summary:
5845  Identifies if the receiver is idle.
5846  Description:
5847  This function identifies if the receiver is idle.
5848  This operation is atomic.
5849  Precondition:
5850  None.
5851  Parameters:
5852  index - Identifier for the device instance to be configured
5853  Returns:
5854  - true - The receive buffer is idle
5855  - false - The receive buffer is not idle
5856  Example:
5857  <code>
5858 #define MY_USART_INSTANCE USART_ID_1
5859  int8_t mydata;
5860  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5861  {
5862  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5863  }
5864  </code>
5865  Remarks:
5866  This feature may not be available on all devices. Please refer to the
5867  specific device data sheet to determine availability or use
5868  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5869  whether this feature is available.
5870 */
5871 
5872 bool
5874  USART_MODULE_ID index ) ;
5875 //******************************************************************************
5876 /* Function:
5877  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5878  Summary:
5879  Enables the USART receiver.
5880  Description:
5881  This function enables the USART receiver.
5882  This operation is atomic.
5883  Precondition:
5884  None.
5885  Parameters:
5886  index - Identifier for the device instance to be configured
5887  Returns:
5888  None.
5889  Example:
5890  <code>
5891 #define MY_USART_INSTANCE USART_ID_1
5892  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5893  </code>
5894  Remarks:
5895  This feature may not be available on all devices. Please refer to the
5896  specific device data sheet to determine availability or use
5897  PLIB_USART_ExistsReceiverEnable in your application to determine
5898  whether this feature is available.
5899 */
5900 
5901 void
5903  USART_MODULE_ID index ) ;
5904 //******************************************************************************
5905 /* Function:
5906  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5907  Summary:
5908  Disables the USART receiver.
5909  Description:
5910  This function disables the USART receiver.
5911  This operation is atomic.
5912  Precondition:
5913  None.
5914  Parameters:
5915  index - Identifier for the device instance to be configured
5916  Returns:
5917  None.
5918  Example:
5919  <code>
5920 #define MY_USART_INSTANCE USART_ID_1
5921  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5922  </code>
5923  Remarks:
5924  This feature may not be available on all devices. Please refer to the
5925  specific device data sheet to determine availability or use
5926  PLIB_USART_ExistsReceiverEnable in your application to determine
5927  whether this feature is available.
5928 */
5929 
5930 void
5932  USART_MODULE_ID index ) ;
5933 //******************************************************************************
5934 /* Function:
5935  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5936  Summary:
5937  Enables the Transmit Idle Low state.
5938  Description:
5939  This function enables the Transmit Idle Low state. In the USART Synchronous
5940  mode, this function configures that the TX polarity, the idle state is low.
5941  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5942  state to a '1'.
5943  This operation is atomic.
5944  Precondition:
5945  None.
5946  Parameters:
5947  index - Identifier for the device instance to be configured
5948  Returns:
5949  None.
5950  Example:
5951  <code>
5952 #define MY_USART_INSTANCE USART_ID_1
5953  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5954  </code>
5955  Remarks:
5956  This feature may not be available on all devices. Please refer to the
5957  specific device data sheet to determine availability or use
5958  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5959  whether this feature is available.
5960 */
5961 
5962 void
5964  USART_MODULE_ID index ) ;
5965 //******************************************************************************
5966 /* Function:
5967  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5968  Summary:
5969  Disables the Transmit Idle Low state.
5970  Description:
5971  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5972  this function configures that the TX polarity the idle state is high.
5973  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5974  state to a '0'.
5975  This operation is atomic.
5976  Precondition:
5977  None.
5978  Parameters:
5979  index - Identifier for the device instance to be configured
5980  Returns:
5981  None.
5982  Example:
5983  <code>
5984 #define MY_USART_INSTANCE USART_ID_1
5985  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5986  </code>
5987  Remarks:
5988  This feature may not be available on all devices. Please refer to the
5989  specific device data sheet to determine availability or use
5990  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5991  whether this feature is available.
5992 */
5993 
5994 void
5996  USART_MODULE_ID index ) ;
5997 //******************************************************************************
5998 /* Function:
5999  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6000  Summary:
6001  Enables receive polarity inversion.
6002  Description:
6003  This function enables receive polarity inversion. In the USART Synchronous mode,
6004  this function configures that the data is inverted.
6005  This operation is atomic.
6006  Precondition:
6007  None.
6008  Parameters:
6009  index - Identifier for the device instance to be configured
6010  Returns:
6011  None.
6012  Example:
6013  <code>
6014 #define MY_USART_INSTANCE USART_ID_1
6015  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6016  </code>
6017  Remarks:
6018  This feature may not be available on all devices. Please refer to the
6019  specific device data sheet to determine availability or use
6020  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6021  whether this feature is available.
6022 */
6023 
6024 void
6026  USART_MODULE_ID index ) ;
6027 //******************************************************************************
6028 /* Function:
6029  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6030  Summary:
6031  Disables receive polarity inversion.
6032  This operation is atomic.
6033  Description:
6034  This function disables receive polarity inversion. In the USART Synchronous
6035  mode, this function configures that the data is not inverted.
6036  Precondition:
6037  None.
6038  Parameters:
6039  index - Identifier for the device instance to be configured
6040  Returns:
6041  None.
6042  Example:
6043  <code>
6044 #define MY_USART_INSTANCE USART_ID_1
6045  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6046  </code>
6047  Remarks:
6048  This feature may not be available on all devices. Please refer to the
6049  specific device data sheet to determine availability or use
6050  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6051  whether this feature is available.
6052 */
6053 
6054 void
6056  USART_MODULE_ID index ) ;
6057 //******************************************************************************
6058 /* Function:
6059  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6060  Summary:
6061  Enables high baud rate selection.
6062  Description:
6063  This function enables high baud rate selection.
6064  This operation is atomic.
6065  Precondition:
6066  None.
6067  Parameters:
6068  index - Identifier for the device instance to be configured
6069  Returns:
6070  None.
6071  Example:
6072  <code>
6073 #define MY_USART_INSTANCE USART_ID_1
6074  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6075  </code>
6076  Remarks:
6077  This feature may not be available on all devices. Please refer to the
6078  specific device data sheet to determine availability or use
6079  PLIB_USART_ExistsBaudRateHigh in your application to determine
6080  whether this feature is available.
6081 */
6082 
6083 void
6085  USART_MODULE_ID index ) ;
6086 //******************************************************************************
6087 /* Function:
6088  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6089  Summary:
6090  Disables the high baud rate selection.
6091  Description:
6092  This function disables the high baud rate selection.
6093  This operation is atomic.
6094  Precondition:
6095  None.
6096  Parameters:
6097  index - Identifier for the device instance to be configured
6098  Returns:
6099  None.
6100  Example:
6101  <code>
6102 #define MY_USART_INSTANCE USART_ID_1
6103  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6104  </code>
6105  Remarks:
6106  This feature may not be available on all devices. Please refer to the
6107  specific device data sheet to determine availability or use
6108  PLIB_USART_ExistsBaudRateHigh in your application to determine
6109  whether this feature is available.
6110 */
6111 
6112 void
6114  USART_MODULE_ID index ) ;
6115 //******************************************************************************
6116 /* Function:
6117  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6118  USART_TRANSMIT_INTR_MODE interruptMode )
6119  Summary:
6120  Sets the USART transmitter interrupt mode.
6121  Description:
6122  This function sets the condition in which the USART module should generate
6123  an interrupt.
6124  This operation is atomic.
6125  Precondition:
6126  None.
6127  Parameters:
6128  index - Identifier for the device instance to be configured
6129  interruptMode - Interrupt mode; for possible configurations, refer to
6130  USART_TRANSMIT_INTR_MODE
6131  Returns:
6132  None.
6133  Example:
6134  <code>
6135 #define MY_USART_INSTANCE USART_ID_1
6136  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6137  USART_TRANSMIT_FIFO_EMPTY );
6138  </code>
6139  Remarks:
6140  This feature may not be available on all devices. Please refer to the
6141  specific device data sheet to determine availability or use
6142  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6143  whether this feature is available.
6144 */
6145 
6146 void
6148  USART_MODULE_ID index ,
6149  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6150 //******************************************************************************
6151 /* Function:
6152  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6153  USART_RECEIVE_INTR_MODE interruptMode )
6154  Summary:
6155  Sets the USART receiver FIFO level.
6156  Description:
6157  This function sets the USART receiver FIFO level.
6158  This operation is atomic.
6159  Precondition:
6160  None.
6161  Parameters:
6162  index - Identifier for the device instance to be configured
6163  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6164  Returns:
6165  None.
6166  Example:
6167  <code>
6168 #define MY_USART_INSTANCE USART_ID_1
6169  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6170  USART_RECEIVE_FIFO_ONE_CHAR );
6171  </code>
6172  Remarks:
6173  This feature may not be available on all devices. Please refer to the
6174  specific device data sheet to determine availability or use
6175  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6176  whether this feature is available.
6177 */
6178 
6179 void
6181  USART_MODULE_ID index ,
6182  USART_RECEIVE_INTR_MODE interruptMode ) ;
6183 //******************************************************************************
6184 /* Function:
6185  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6186  USART_LINECONTROL_MODE dataFlowConfig)
6187  Summary:
6188  Sets the data flow configuration.
6189  Description:
6190  This function sets the USART data flow configuration based on the mask
6191  provided and the specified baud rate.
6192  Precondition:
6193  None.
6194  Parameters:
6195  index - Identifier for the device instance to be configured
6196  mode - For possible data flow configurations, refer to
6197  USART_LINECONTROL_MODE
6198  Returns:
6199  None.
6200  Example:
6201  <code>
6202 #define MY_USART_INSTANCE USART_ID_1
6203  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6204  USART_8N1);
6205  </code>
6206  Remarks:
6207  This feature may not be available on all devices. Please refer to the
6208  specific device data sheet to determine availability or use
6209  PLIB_USART_ExistsLineControlMode in your application to determine
6210  whether this feature is available.
6211 */
6212 
6213 void
6215  USART_MODULE_ID index ,
6216  USART_LINECONTROL_MODE dataFlowConfig ) ;
6217 //******************************************************************************
6218 /* Function:
6219  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6220  USART_HANDSHAKE_MODE handshakeConfig)
6221  Summary:
6222  Sets the data flow configuration.
6223  Description:
6224  This function sets the USART data flow configuration based on the mask
6225  provided and the specified baud rate.
6226  Precondition:
6227  None.
6228  Parameters:
6229  index - Identifier for the device instance to be configured
6230  mode - For possible data flow configurations, refer to
6231  USART_HANDSHAKE_MODE
6232  Returns:
6233  None.
6234  Example:
6235  <code>
6236 #define MY_USART_INSTANCE USART_ID_1
6237  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6238  USART_HANDSHAKE_MODE_SIMPLEX);
6239  </code>
6240  Remarks:
6241  This feature may not be available on all devices. Please refer to the
6242  specific device data sheet to determine availability or use
6243  PLIB_USART_ExistsHandshakeMode in your application to determine
6244  whether this feature is available.
6245 */
6246 
6247 void
6249  USART_MODULE_ID index ,
6250  USART_HANDSHAKE_MODE handshakeConfig ) ;
6251 //******************************************************************************
6252 /* Function:
6253  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6254  int8_t Mask)
6255  Summary:
6256  Setup the automatic Address Detect mode.
6257  Description:
6258  This function configures the automatic Address Detect mode. Uses the mask as
6259  the address character for automatic address detection.
6260  This operation is atomic.
6261  Precondition:
6262  None.
6263  Parameters:
6264  index - Identifier for the device instance to be configured
6265  Mask - Address character to be used, when enabled
6266  Returns:
6267  None.
6268  Example:
6269  <code>
6270 #define MY_USART_INSTANCE USART_ID_1
6271  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6272  MY_DEVICE_ADDRESS);
6273  </code>
6274  Remarks:
6275  This feature may not be available on all devices. Please refer to the
6276  specific device data sheet to determine availability or use
6277  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6278  whether this feature is available.
6279 */
6280 
6281 void
6283  USART_MODULE_ID index ,
6284  int8_t Mask ) ;
6285 //******************************************************************************
6286 /* Function:
6287  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6288  USART_MODULE_ID index )
6289  Summary:
6290  Disables the automatic Address Detect mode.
6291  Description:
6292  This function disables the automatic Address Detect mode.
6293  This operation is atomic.
6294  Precondition:
6295  None.
6296  Parameters:
6297  index - Identifier for the device instance to be configured
6298  Returns:
6299  None.
6300  Example:
6301  <code>
6302 #define MY_USART_INSTANCE USART_ID_1
6303  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6304  </code>
6305  Remarks:
6306  This feature may not be available on all devices. Please refer to the
6307  specific device data sheet to determine availability or use
6308  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6309  whether this feature is available.
6310 */
6311 
6312 void
6314  USART_MODULE_ID index ) ;
6315 //******************************************************************************
6316 /* Function:
6317  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6318  Summary:
6319  Enables the IrDA encoder and decoder.
6320  Description:
6321  This function enables the IrDA encoder and decoder.
6322  This operation is atomic.
6323  Precondition:
6324  None.
6325  Parameters:
6326  index - Identifier for the device instance to be configured
6327  Returns:
6328  None.
6329  Example:
6330  <code>
6331 #define MY_USART_INSTANCE USART_ID_1
6332  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6333  </code>
6334  Remarks:
6335  This feature may not be available on all devices. Please refer to the
6336  specific device data sheet to determine availability or use
6337  PLIB_USART_ExistsIrDA in your application to determine
6338  whether this feature is available.
6339 */
6340 
6341 void
6343  USART_MODULE_ID index ) ;
6344 //******************************************************************************
6345 /* Function:
6346  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6347  Summary:
6348  Disables the IrDA encoder and decoder.
6349  Description:
6350  This function disables the IrDA encoder and decoder.
6351  This operation is atomic.
6352  Precondition:
6353  None.
6354  Parameters:
6355  index - Identifier for the device instance to be configured
6356  Returns:
6357  None.
6358  Example:
6359  <code>
6360 #define MY_USART_INSTANCE USART_ID_1
6361  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6362  </code>
6363  Remarks:
6364  By default, the IrDA Encoder and Decoder are disabled.
6365 
6366  This feature may not be available on all devices. Please refer to the
6367  specific device data sheet to determine availability or use
6368  PLIB_USART_ExistsIrDA in your application to determine
6369  whether this feature is available.
6370 */
6371 
6372 void
6374  USART_MODULE_ID index ) ;
6375 //******************************************************************************
6376 /* Function:
6377  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6378  Summary:
6379  Enables Loopback mode.
6380  Description:
6381  This function enables Loopback mode.
6382  This operation is atomic.
6383  Precondition:
6384  None.
6385  Parameters:
6386  index - Identifier for the device instance to be configured
6387  Returns:
6388  None.
6389  Example:
6390  <code>
6391 #define MY_USART_INSTANCE USART_ID_1
6392  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6393  </code>
6394  Remarks:
6395  By default, Loopback mode is disabled.
6396 
6397  This feature may not be available on all devices. Please refer to the
6398  specific device data sheet to determine availability or use
6399  PLIB_USART_ExistsLoopback in your application to determine
6400  whether this feature is available.
6401 */
6402 
6403 void
6405  USART_MODULE_ID index ) ;
6406 //******************************************************************************
6407 /* Function:
6408  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6409  Summary:
6410  Disables Loopback mode.
6411  Description:
6412  This function disables Loopback mode.
6413  This operation is atomic.
6414  Precondition:
6415  None.
6416  Parameters:
6417  index - Identifier for the device instance to be configured
6418  Returns:
6419  None.
6420  Example:
6421  <code>
6422 #define MY_USART_INSTANCE USART_ID_1
6423  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6424  </code>
6425  Remarks:
6426  By default, Loopback mode is disabled.
6427  This feature may not be available on all devices. Please refer to the
6428  specific device data sheet to determine availability or use
6429  PLIB_USART_ExistsLoopback in your application to determine
6430  whether this feature is available.
6431 */
6432 
6433 void
6435  USART_MODULE_ID index ) ;
6436 //******************************************************************************
6437 /* Function:
6438  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6439  USART_OPERATION_MODE operationmode)
6440  Summary:
6441  Configures the operation mode of the USART module.
6442  Description:
6443  This function configures the operation mode of the USART (i.e., controls the
6444  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6445  possible settings.
6446  Precondition:
6447  None.
6448  Parameters:
6449  index - Identifier for the device instance to be configured
6450  operationmode - One of the possible values from USART_OPERATION_MODE
6451  Returns:
6452  None.
6453  Example:
6454  <code>
6455 #define MY_USART_INSTANCE USART_ID_1
6456  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6457  </code>
6458  Remarks:
6459  This feature may not be available on all devices. Please refer to the
6460  specific device data sheet to determine availability or use
6461  PLIB_USART_ExistsOperationMode in your application to determine
6462  whether this feature is available.
6463 */
6464 
6465 void
6467  USART_MODULE_ID index ,
6468  USART_OPERATION_MODE operationmode ) ;
6469 //******************************************************************************
6470 /* Function:
6471  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6472  Summary:
6473  Discontinues operation when the device enters Idle mode.
6474  Description:
6475  This function enables the USART module to discontinue operation when the
6476  device enters Idle mode.
6477  This operation is atomic.
6478  Precondition:
6479  None.
6480  Parameters:
6481  index - Identifier for the device instance to be configured
6482  Returns:
6483  None.
6484  Example:
6485  <code>
6486 #define MY_USART_INSTANCE USART_ID_1
6487  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6488  </code>
6489  Remarks:
6490  This feature may not be available on all devices. Please refer to the
6491  specific device data sheet to determine availability or use
6492  PLIB_USART_ExistsStopInIdle in your application to determine
6493  whether this feature is available.
6494 */
6495 
6496 void
6498  USART_MODULE_ID index ) ;
6499 //******************************************************************************
6500 /* Function:
6501  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6502  Summary:
6503  Disables the Stop in Idle mode (the USART module continues operation when
6504  the device is in Idle mode).
6505  Description:
6506  This function disables the Stop in Idle mode. The USART module continues
6507  operation when the device is in Idle mode.
6508  This operation is atomic.
6509  Precondition:
6510  None.
6511  Parameters:
6512  index - Identifier for the device instance to be configured
6513  Returns:
6514  None.
6515  Example:
6516  <code>
6517 #define MY_USART_INSTANCE USART_ID_1
6518  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6519  </code>
6520  Remarks:
6521  By default, the USART module will continue operation in Idle mode.
6522 
6523  This feature may not be available on all devices. Please refer to the
6524  specific device data sheet to determine availability or use
6525  PLIB_USART_ExistsStopInIdle in your application to determine
6526  whether this feature is available.
6527 */
6528 
6529 void
6531  USART_MODULE_ID index ) ;
6532 //******************************************************************************
6533 /* Function:
6534  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6535  Summary:
6536  Enables the wake-up on start bit detection feature during Sleep mode.
6537  Description:
6538  This function enables the wake-up on start feature during Sleep mode.
6539  This operation is atomic.
6540  Precondition:
6541  None.
6542  Parameters:
6543  index - Identifier for the device instance to be configured
6544  Returns:
6545  None.
6546  Example:
6547  <code>
6548 #define MY_USART_INSTANCE USART_ID_1
6549  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6550  </code>
6551  Remarks:
6552  This feature may not be available on all devices. Please refer to the
6553  specific device data sheet to determine availability or use
6554  PLIB_USART_ExistsWakeOnStart in your application to determine
6555  whether this feature is available.
6556 */
6557 
6558 void
6560  USART_MODULE_ID index ) ;
6561 //******************************************************************************
6562 /* Function:
6563  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6564  Summary:
6565  Disables the wake-up on start bit detection feature during Sleep mode.
6566  Description:
6567  This function disables the wake-up on start bit detection feature during
6568  Sleep mode.
6569  This operation is atomic.
6570  Precondition:
6571  None.
6572  Parameters:
6573  index - Identifier for the device instance to be configured
6574  Returns:
6575  None.
6576  Example:
6577  <code>
6578 #define MY_USART_INSTANCE USART_ID_1
6579  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6580  </code>
6581  Remarks:
6582  This feature may not be available on all devices. Please refer to the
6583  specific device data sheet to determine availability or use
6584  PLIB_USART_ExistsWakeOnStart in your application to determine
6585  whether this feature is available.
6586 */
6587 
6588 void
6590  USART_MODULE_ID index ) ;
6591 //******************************************************************************
6592 /* Function:
6593  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6594  Summary:
6595  Gets the state of the sync break event completion.
6596  Description:
6597  This function returns the status of the sync break event, when called
6598  after enabling using PLIB_USART_WakeOnStartEnable.
6599  This operation is atomic.
6600  Precondition:
6601  None.
6602  Parameters:
6603  index - Identifier for the device instance to be configured
6604  Returns:
6605  None.
6606  Example:
6607  <code>
6608 #define MY_USART_INSTANCE USART_ID_1
6609  //Call the interface just prior to entering the sleep mode.
6610  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6611  // Check the status if the Sync break event is over.
6612  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6613  {
6614  // Do Something
6615  }
6616  </code>
6617  Remarks:
6618  This feature may not be available on all devices. Please refer to the
6619  specific device data sheet to determine availability or use
6620  PLIB_USART_ExistsWakeOnStart in your application to determine
6621  whether this feature is available.
6622 */
6623 
6624 bool
6626  USART_MODULE_ID index ) ;
6627 //******************************************************************************
6628 /* Function:
6629  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6630  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6631  Summary:
6632  Enables or disables general features of the USART module.
6633  Description:
6634  This function enables or disables general features of the USART module.
6635  Precondition:
6636  None.
6637  Parameters:
6638  index - Identifier for the device instance to be configured
6639  autobaud - If true, auto baud rate detection is enabled. If false
6640  the feature is disabled.
6641  loopBackMode - If true, loop back is enabled. If false the feature is
6642  disabled.
6643  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6644  mode on USART activity. If false the feature is disabled.
6645  irdaMode - If true, the IrDA mode is enabled. If false the feature
6646  is disabled.
6647  stopInIdle - If true, module will stop functioning when CPU enters Idle
6648  mode. If false, the feature is disabled.
6649  Returns:
6650  None.
6651  Example:
6652  <code>
6653 #define MY_USART_INSTANCE USART_ID_1
6654  // Enable loopback, disable IrDA, disable auto baud detection and disable
6655  // wake from sleep. Enable stop in idle
6656  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6657  false, false, true);
6658  </code>
6659  Remarks:
6660  Enabling the wake from sleep feature will cause the first character that is
6661  received by the USART module to be discarded. This feature should only be
6662  enabled if the CPU is to placed in power saving mode.
6663 
6664  This feature may not be available on all devices. Please refer to the
6665  specific device data sheet to determine availability. Availability of this
6666  function can also be determined if all of the following functions return
6667  true:
6668  - PLIB_USART_ExistsLoopback
6669  - PLIB_USART_ExistsBaudRateAutoDetect
6670  - PLIB_USART_ExistsWakeOnStart
6671  - PLIB_USART_ExistsIrDA
6672  - PLIB_USART_ExistsStopInIdle
6673 */
6674 
6675 void
6677  USART_MODULE_ID index ,
6678  bool autobaud ,
6679  bool loopBackMode ,
6680  bool wakeFromSleep ,
6681  bool irdaMode ,
6682  bool stopInIdle ) ;
6683 //******************************************************************************
6684 /* Function:
6685  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6686  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6687  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6688  USART_OPERATION_MODE operationMode);
6689  Summary:
6690  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6691  lines to be used by the module.
6692  Description:
6693  This function configures the Receive and Transmit FIFO interrupt levels and
6694  the hardware lines to be used by the module.
6695  Precondition:
6696  None.
6697  Parameters:
6698  index - Identifier for the device instance to be configured
6699  receiveInterruptMode - Receiver FIFO interrupt level
6700  transmitInterruptMode - Transmit FIFO interrupt level
6701  operationMode - Hardware lines to be used by the USART.
6702  Returns:
6703  None.
6704  Example:
6705  <code>
6706 #define MY_USART_INSTANCE USART_ID_1
6707  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6708  // Set Transmit FIFO to interrupt when FIFO is empty
6709  // USART module will only use RX and TX hardware lines
6710  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6711  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6712  </code>
6713  Remarks:
6714  This feature may not be available on all devices. Please refer to the
6715  specific device data sheet to determine availability. Availability of this
6716  function can also be determined if all of the following functions return
6717  true:
6718  - PLIB_USART_ExistsReceiverInterruptMode
6719  - PLIB_USART_ExistsTransmitterInterruptMode
6720  - PLIB_USART_ExistsOperationMode
6721 */
6722 
6723 void
6725  USART_MODULE_ID index ,
6726  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6727  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6728  USART_OPERATION_MODE operationMode ) ;
6729 //******************************************************************************
6730 /* Function:
6731  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6732  clockFrequency, uint32_t baudRate );
6733  Summary:
6734  Sets the baud rate to the desired value and enables the USART receiver,
6735  transmitter and the USART module.
6736  Description:
6737  This function sets the baud rate to the desired value and enables the USART
6738  receiver, USART transmitter and USART module.
6739  Precondition:
6740  None.
6741  Parameters:
6742  index - Identifier for the device instance to be configured
6743  baudRate - Baud Rate Value
6744  clockFrequency - Clock Frequency
6745  Returns:
6746  None.
6747  Example:
6748  <code>
6749 #define MY_USART_INSTANCE USART_ID_1
6750  uint32_t baudRateValue ;
6751  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6752  </code>
6753  Remarks:
6754  Setting a new baud rate value causes the baud rate timer to reset.
6755  This ensures that the baud rate timer does not have to overflow before
6756  outputting the new baud rate.
6757 
6758  If the system clock is changed during an active receive operation, a
6759  receiver error or data loss may result. To avoid this issue verify that
6760  no receptions are in progress before changing the system clock.
6761 
6762  This feature may not be available on all devices. Please refer to the
6763  specific device data sheet to determine availability. Availability of this
6764  function can also be determined if all of the following functions return
6765  true:
6766  - PLIB_USART_ExistsBaudRate
6767  - PLIB_USART_ExistsTransmitterEnable
6768  - PLIB_USART_ExistsReceiverEnable
6769  - PLIB_USART_ExistsEnable
6770 */
6771 
6772 void
6774  USART_MODULE_ID index ,
6775  uint32_t systemClock ,
6776  uint32_t baud ) ;
6777 //******************************************************************************
6778 /* Function:
6779  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6780  Summary:
6781  Return the status of all errors in the specified USART module.
6782  Description:
6783  This function returns status of all errors in the specified USART module.
6784  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6785  status of a specific error.
6786  This operation is atomic.
6787  Precondition:
6788  None.
6789  Parameters:
6790  index - Identifier for the device instance to be configured
6791  Returns:
6792  Returns a bitmap of USART error status.
6793  Example:
6794  <code>
6795 #define MY_USART_INSTANCE USART_ID_1
6796  USART_ERROR error;
6797  // Get the status of all errors.
6798  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6799  // Check if parity error is active
6800  if(error & USART_ERROR_PARITY)
6801  {
6802  // Parity error is active.
6803  }
6804  else if(error & USART_ERROR_FRAMING)
6805  {
6806  // Framing error is active.
6807  }
6808  </code>
6809  Remarks:
6810  This feature may not be available on all devices. Please refer to the
6811  specific device data sheet to determine availability. Availability of this
6812  function can also be determined if all of the followings functions return
6813  true:
6814  - PLIB_USART_ExistsReceiverFramingErrorStatus
6815  - PLIB_USART_ExistsReceiverParityErrorStatus
6816  - PLIB_USART_ExistsReceiverOverrunStatus
6817 */
6818 
6819 USART_ERROR
6821  USART_MODULE_ID index ) ;
6822 //******************************************************************************
6823 /* Function:
6824  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6825  Summary:
6826  Returns the address of the USART TX register
6827  Description:
6828  This function returns the address of the USART TX register.
6829  This operation is atomic.
6830  Preconditions:
6831  None.
6832  Parameters:
6833  index - Identifier for the device instance
6834  Returns:
6835  Address of the USART TX register
6836  Remarks:
6837  None.
6838 */
6839 
6840 void *
6842  USART_MODULE_ID index ) ;
6843 //******************************************************************************
6844 /* Function:
6845  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6846  Summary:
6847  Returns the address of the USART RX register
6848  Description:
6849  This function returns the address of the USART RX register.
6850  This operation is atomic.
6851  Preconditions:
6852  None.
6853  Parameters:
6854  index - Identifier for the device instance
6855  Returns:
6856  Address of the USART RX register
6857  Remarks:
6858  None.
6859 */
6860 
6861 void *
6863  USART_MODULE_ID index ) ;
6864 // *****************************************************************************
6865 // *****************************************************************************
6866 // Section: USART Peripheral Library Exists Functions
6867 // *****************************************************************************
6868 // *****************************************************************************
6869 /* The following functions indicate the existence of the features on the device.
6870 */
6871 //******************************************************************************
6872 /* Function:
6873  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6874  Summary:
6875  Identifies whether the Run in overflow condition feature exists on the USART module.
6876  Description:
6877  This function identifies whether the Run in Overflow condition feature is
6878  available on the USART module. When this function returns true, these
6879  functions are supported on the device:
6880  - PLIB_USART_RunInOverflowEnable
6881  - PLIB_USART_RunInOverflowDisable
6882  - PLIB_USART_RunInOverflowIsEnabled
6883  This operation is atomic.
6884  Preconditions:
6885  None.
6886  Parameters:
6887  index - Identifier for the device instance
6888  Returns:
6889  - true - The Run in Overflow condition feature is supported on the device
6890  - false - The Run in Overflow condition feature is not supported on the device
6891  Remarks:
6892  None.
6893 */
6894 
6895 bool
6897  USART_MODULE_ID index ) ;
6898 //******************************************************************************
6899 /* Function:
6900  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6901  Summary:
6902  Identifies whether the BRG Clock source select feature exists on the
6903  USART module.
6904  Description:
6905  This function identifies whether the BRG Clock source select feature is
6906  available on the USART module. When this function returns true, these
6907  functions are supported on the device:
6908  - PLIB_USART_BRGClockSourceSelect
6909  - PLIB_USART_BRGClockSourceGet
6910  This operation is atomic.
6911  Preconditions:
6912  None.
6913  Parameters:
6914  index - Identifier for the device instance
6915  Returns:
6916  - true - The BRG clock source select feature is supported on the device
6917  - false - The BRG clock source select feature is not supported on the device
6918  Remarks:
6919  None.
6920 */
6921 
6922 bool
6924  USART_MODULE_ID index ) ;
6925 //******************************************************************************
6926 /* Function:
6927  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6928  Summary:
6929  Identifies whether the module running status feature exists on the
6930  USART module.
6931  Description:
6932  This function identifies whether the module running status feature is
6933  available on the USART module. When this function returns true, this
6934  function is supported on the device:
6935  - PLIB_USART_ModuleIsBusy
6936  This operation is atomic.
6937  Preconditions:
6938  None.
6939  Parameters:
6940  index - Identifier for the device instance
6941  Returns:
6942  - true - The Module running status feature is supported on the device
6943  - false - The Module running status feature is not supported on the device
6944  Remarks:
6945  None.
6946 */
6947 
6948 bool
6950  USART_MODULE_ID index ) ;
6951 //******************************************************************************
6952 /* Function:
6953  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6954  Summary:
6955  Identifies whether the Run in Sleep mode feature exists on the USART module.
6956  Description:
6957  This function identifies whether the Run in Sleep mode feature is
6958  available on the USART module. When this function returns true, these
6959  functions are supported on the device:
6960  - PLIB_USART_RunInSleepModeEnable
6961  - PLIB_USART_RunInSleepModeDisable
6962  - PLIB_USART_RunInSleepModeIsEnabled
6963  This operation is atomic.
6964  Preconditions:
6965  None.
6966  Parameters:
6967  index - Identifier for the device instance
6968  Returns:
6969  - true - The Run in Sleep mode feature is supported on the device
6970  - false - The Run in Sleep mode feature is not supported on the device
6971  Remarks:
6972  None.
6973 */
6974 
6975 bool
6977  USART_MODULE_ID index ) ;
6978 //******************************************************************************
6979 /* Function:
6980  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6981  Summary:
6982  Identifies whether the EnableControl feature exists on the USART module.
6983  Description:
6984  This function identifies whether the EnableControl feature is
6985  available on the USART module. When this function returns true, these
6986  functions are supported on the device:
6987  - PLIB_USART_Disable
6988  - PLIB_USART_Enable
6989  This operation is atomic.
6990  Preconditions:
6991  None.
6992  Parameters:
6993  index - Identifier for the device instance
6994  Returns:
6995  - true - The EnableControl feature is supported on the device
6996  - false - The EnableControl feature is not supported on the device
6997  Remarks:
6998  None.
6999 */
7000 
7001 bool
7003  USART_MODULE_ID index ) ;
7004 //******************************************************************************
7005 /* Function:
7006  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7007  Summary:
7008  Identifies whether the HandShakeMode feature exists on the USART module.
7009  Description:
7010  This function identifies whether the HandShakeMode feature is
7011  available on the USART module. When this function returns true, this
7012  function is supported on the device:
7013  - PLIB_USART_HandshakeModeSelect
7014  This operation is atomic.
7015  Preconditions:
7016  None.
7017  Parameters:
7018  index - Identifier for the device instance
7019  Returns:
7020  - true - The HandShakeMode feature is supported on the device
7021  - false - The HandShakeMode feature is not supported on the device
7022  Remarks:
7023  None.
7024 */
7025 
7026 bool
7028  USART_MODULE_ID index ) ;
7029 //******************************************************************************
7030 /* Function:
7031  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7032  Summary:
7033  Identifies whether the IrDAControl feature exists on the USART module.
7034  Description:
7035  This function identifies whether the IrDAControl feature is
7036  available on the USART module. When this function returns true, these
7037  functions are supported on the device:
7038  - PLIB_USART_IrDADisable
7039  - PLIB_USART_IrDAEnable
7040  This operation is atomic.
7041  Preconditions:
7042  None.
7043  Parameters:
7044  index - Identifier for the device instance
7045  Returns:
7046  - true - The IrDAControl feature is supported on the device
7047  - false - The IrDAControl feature is not supported on the device
7048  Remarks:
7049  None.
7050 */
7051 
7052 bool
7054  USART_MODULE_ID index ) ;
7055 //******************************************************************************
7056 /* Function:
7057  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7058  Summary:
7059  Identifies whether the LineControlMode feature exists on the USART module.
7060  Description:
7061  This function identifies whether the LineControlMode feature is
7062  available on the USART module. When this function returns true, this
7063  function is supported on the device:
7064  - PLIB_USART_LineControlModeSelect
7065  This operation is atomic.
7066  Preconditions:
7067  None.
7068  Parameters:
7069  index - Identifier for the device instance
7070  Returns:
7071  - true - The LineControlMode feature is supported on the device
7072  - false - The LineControlMode feature is not supported on the device
7073  Remarks:
7074  None.
7075 */
7076 
7077 bool
7079  USART_MODULE_ID index ) ;
7080 //******************************************************************************
7081 /* Function:
7082  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7083  Summary:
7084  Identifies whether the Loopback feature exists on the USART module.
7085  Description:
7086  This function identifies whether the Loopback feature is
7087  available on the USART module. When this function returns true, these
7088  functions are supported on the device:
7089  - PLIB_USART_LoopbackEnable
7090  - PLIB_USART_LoopbackDisable
7091  This operation is atomic.
7092  Preconditions:
7093  None.
7094  Parameters:
7095  index - Identifier for the device instance
7096  Returns:
7097  - true - The Loopback feature is supported on the device
7098  - false - The Loopback feature is not supported on the device
7099  Remarks:
7100  None.
7101 */
7102 
7103 bool
7105  USART_MODULE_ID index ) ;
7106 //******************************************************************************
7107 /* Function:
7108  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7109  Summary:
7110  Identifies whether the OperationMode feature exists on the USART module.
7111  Description:
7112  This function identifies whether the OperationMode feature is
7113  available on the USART module. When this function returns true, this
7114  function is supported on the device:
7115  - PLIB_USART_OperationModeSelect
7116  This operation is atomic.
7117  Preconditions:
7118  None.
7119  Parameters:
7120  index - Identifier for the device instance
7121  Returns:
7122  - true - The OperationMode feature is supported on the device
7123  - false - The OperationMode feature is not supported on the device
7124  Remarks:
7125  None.
7126 */
7127 
7128 bool
7130  USART_MODULE_ID index ) ;
7131 //******************************************************************************
7132 /* Function:
7133  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7134  Summary:
7135  Identifies whether the StopInIdle feature exists on the USART module.
7136  Description:
7137  This function identifies whether the StopInIdle feature is
7138  available on the USART module. When this function returns true, these
7139  functions are supported on the device:
7140  - PLIB_USART_StopInIdleEnable
7141  - PLIB_USART_StopInIdleDisable
7142  This operation is atomic.
7143  Preconditions:
7144  None.
7145  Parameters:
7146  index - Identifier for the device instance
7147  Returns:
7148  - true - The StopInIdle feature is supported on the device
7149  - false - The StopInIdle feature is not supported on the device
7150  Remarks:
7151  None.
7152 */
7153 
7154 bool
7156  USART_MODULE_ID index ) ;
7157 //******************************************************************************
7158 /* Function:
7159  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7160  Summary:
7161  Identifies whether the WakeOnStart feature exists on the USART module.
7162  Description:
7163  This function identifies whether the WakeOnStart feature is
7164  available on the USART module. When this function returns true, these
7165  functions are supported on the device:
7166  - PLIB_USART_WakeOnStartEnable
7167  - PLIB_USART_WakeOnStartDisable
7168  - PLIB_USART_WakeOnStartIsEnabled
7169  This operation is atomic.
7170  Preconditions:
7171  None.
7172  Parameters:
7173  index - Identifier for the device instance
7174  Returns:
7175  - true - The WakeOnStart feature is supported on the device
7176  - false - The WakeOnStart feature is not supported on the device
7177  Remarks:
7178  None.
7179 */
7180 
7181 bool
7183  USART_MODULE_ID index ) ;
7184 //******************************************************************************
7185 /* Function:
7186  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7187  Summary:
7188  Identifies whether the BaudRate feature exists on the USART module.
7189  Description:
7190  This function identifies whether the BaudRate feature is
7191  available on the USART module. When this function returns true, these
7192  functions are supported on the device:
7193  - PLIB_USART_BaudRateSet
7194  - PLIB_USART_BaudRateGet
7195  This operation is atomic.
7196  Preconditions:
7197  None.
7198  Parameters:
7199  index - Identifier for the device instance
7200  Returns:
7201  - true - The BaudRate feature is supported on the device
7202  - false - The BaudRate feature is not supported on the device
7203  Remarks:
7204  None.
7205 */
7206 
7207 bool
7209  USART_MODULE_ID index ) ;
7210 //******************************************************************************
7211 /* Function:
7212  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7213  Summary:
7214  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7215  Description:
7216  This function identifies whether the BaudRateAutoDetect feature is
7217  available on the USART module. When this function returns true, these
7218  functions are supported on the device:
7219  - PLIB_USART_BaudRateAutoDetectEnable
7220  - PLIB_USART_BaudRateAutoDetectIsComplete
7221  This operation is atomic.
7222  Preconditions:
7223  None.
7224  Parameters:
7225  index - Identifier for the device instance
7226  Returns:
7227  - true - The BaudRateAutoDetect feature is supported on the device
7228  - false - The BaudRateAutoDetect feature is not supported on the device
7229  Remarks:
7230  None.
7231 */
7232 
7233 bool
7235  USART_MODULE_ID index ) ;
7236 //******************************************************************************
7237 /* Function:
7238  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7239  Summary:
7240  Identifies whether the BaudRateHigh feature exists on the USART module.
7241  Description:
7242  This function identifies whether the BaudRateHigh feature is
7243  available on the USART module. When this function returns true, these
7244  functions are supported on the device:
7245  - PLIB_USART_BaudRateHighSet
7246  - PLIB_USART_BaudRateHighDisable
7247  - PLIB_USART_BaudRateHighEnable
7248  This operation is atomic.
7249  Preconditions:
7250  None.
7251  Parameters:
7252  index - Identifier for the device instance
7253  Returns:
7254  - true - The BaudRateHigh feature is supported on the device
7255  - false - The BaudRateHigh feature is not supported on the device
7256  Remarks:
7257  None.
7258 */
7259 
7260 bool
7262  USART_MODULE_ID index ) ;
7263 //******************************************************************************
7264 /* Function:
7265  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7266  Summary:
7267  Identifies whether the Receiver Address feature exists on the USART
7268  module.
7269  Description:
7270  This function identifies whether the Receiver Address feature is
7271  available on the USART module. When this function returns true, these
7272  functions are supported on the device:
7273  - PLIB_USART_AddressSet
7274  - PLIB_USART_AddressGet
7275  This operation is atomic.
7276  Preconditions:
7277  None.
7278  Parameters:
7279  index - Identifier for the device instance
7280  Returns:
7281  - true - The Receiver address feature is supported on the device
7282  - false - The Receiver address feature is not supported on the device
7283  Remarks:
7284  None.
7285 */
7286 
7287 bool
7289  USART_MODULE_ID index ) ;
7290 //******************************************************************************
7291 /* Function:
7292  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7293  Summary:
7294  Identifies whether the Receiver Address Mask feature exists on the USART
7295  module.
7296  Description:
7297  This function identifies whether the Receiver Address Mask feature is
7298  available on the USART module. When this function returns true, these
7299  functions are supported on the device:
7300  - PLIB_USART_AddressMaskSet
7301  - PLIB_USART_AddressMaskGet
7302  This operation is atomic.
7303  Preconditions:
7304  None.
7305  Parameters:
7306  index - Identifier for the device instance
7307  Returns:
7308  - true - The Receiver address mask feature is supported on the device
7309  - false - The Receiver address mask feature is not supported on the device
7310  Remarks:
7311  None.
7312 */
7313 
7314 bool
7316  USART_MODULE_ID index ) ;
7317 //******************************************************************************
7318 /* Function:
7319  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7320  Summary:
7321  Identifies whether the Receiver feature exists on the USART module.
7322  Description:
7323  This function identifies whether the Receiver feature is available on the
7324  USART module. When this function returns true, these functions are supported
7325  on the device:
7326  - PLIB_USART_ReceiverByteReceive
7327  - PLIB_USART_ReceiverAddressGet
7328  This operation is atomic.
7329  Preconditions:
7330  None.
7331  Parameters:
7332  index - Identifier for the device instance
7333  Returns:
7334  - true - The Receiver feature is supported on the device
7335  - false - The Receiver feature is not supported on the device
7336  Remarks:
7337  None.
7338 */
7339 
7340 bool
7342  USART_MODULE_ID index ) ;
7343 //******************************************************************************
7344 /* Function:
7345  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7346  Summary:
7347  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7348  Description:
7349  This function identifies whether the 9 Bits Receiver feature is available on the
7350  USART module. When this function returns true, this function is supported
7351  on the device:
7352  - PLIB_USART_Receiver9BitsReceive
7353  This operation is atomic.
7354  Preconditions:
7355  None.
7356  Parameters:
7357  index - Identifier for the device instance
7358  Returns:
7359  - true - The feature is supported on the device
7360  - false - The feature is not supported on the device
7361  Remarks:
7362  None.
7363 */
7364 
7365 bool
7367  USART_MODULE_ID index ) ;
7368 //******************************************************************************
7369 /* Function:
7370  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7371  Summary:
7372  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7373  Description:
7374  This function identifies whether the ReceiverAddressAutoDetect feature is
7375  available on the USART module. When this function returns true, these
7376  functions are supported on the device:
7377  - PLIB_USART_ReceiverAddressAutoDetectEnable
7378  - PLIB_USART_ReceiverAddressAutoDetectDisable
7379  This operation is atomic.
7380  Preconditions:
7381  None.
7382  Parameters:
7383  index - Identifier for the device instance
7384  Returns:
7385  - true - The ReceiverAddressAutoDetect feature is supported on the device
7386  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7387  Remarks:
7388  None.
7389 */
7390 
7391 bool
7393  USART_MODULE_ID index ) ;
7394 //******************************************************************************
7395 /* Function:
7396  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7397  Summary:
7398  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7399  Description:
7400  This function identifies whether the ReceiverAddressDetect feature is
7401  available on the USART module. When this function returns true, these
7402  functions are supported on the device:
7403  - PLIB_USART_ReceiverAddressDetectEnable
7404  - PLIB_USART_ReceiverAddressDetectDisable
7405  - PLIB_USART_ReceiverAddressIsReceived
7406  This operation is atomic.
7407  Preconditions:
7408  None.
7409  Parameters:
7410  index - Identifier for the device instance
7411  Returns:
7412  - true - The ReceiverAddressDetect feature is supported on the device
7413  - false - The ReceiverAddressDetect feature is not supported on the device
7414  Remarks:
7415  None.
7416 */
7417 
7418 bool
7420  USART_MODULE_ID index ) ;
7421 //******************************************************************************
7422 /* Function:
7423  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7424  Summary:
7425  Identifies whether the ReceiverDataAvailable feature exists on the USART
7426  module
7427  Description:
7428  This function identifies whether the ReceiverDataAvailable feature is
7429  available on the USART module. When this function returns true, this
7430  function is supported on the device:
7431  - PLIB_USART_ReceiverDataIsAvailable
7432  This operation is atomic.
7433  Preconditions:
7434  None.
7435  Parameters:
7436  index - Identifier for the device instance
7437  Returns:
7438  - true - The ReceiverDataAvailable feature is supported on the device
7439  - false - The ReceiverDataAvailable feature is not supported on the device
7440  Remarks:
7441  None.
7442 */
7443 
7444 bool
7446  USART_MODULE_ID index ) ;
7447 //******************************************************************************
7448 /* Function:
7449  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7450  Summary:
7451  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7452  Description:
7453  This function identifies whether the ReceiverEnableControl feature is
7454  available on the USART module. When this function returns true, these
7455  functions are supported on the device:
7456  - PLIB_USART_ReceiverEnable
7457  - PLIB_USART_ReceiverDisable
7458  This operation is atomic.
7459  Preconditions:
7460  None.
7461  Parameters:
7462  index - Identifier for the device instance
7463  Returns:
7464  - true - The ReceiverEnableControl feature is supported on the device
7465  - false - The ReceiverEnableControl feature is not supported on the device
7466  Remarks:
7467  None.
7468 */
7469 
7470 bool
7472  USART_MODULE_ID index ) ;
7473 //******************************************************************************
7474 /* Function:
7475  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7476  Summary:
7477  Identifies whether the ReceiverIdle feature exists on the USART module.
7478  Description:
7479  This function identifies whether the ReceiverIdle feature is
7480  available on the USART module. When this function returns true, this
7481  function is supported on the device:
7482  - PLIB_USART_ReceiverIsIdle
7483  This operation is atomic.
7484  Preconditions:
7485  None.
7486  Parameters:
7487  index - Identifier for the device instance
7488  Returns:
7489  - true - The ReceiverIdle feature is supported on the device
7490  - false - The ReceiverIdle feature is not supported on the device
7491  Remarks:
7492  None.
7493 */
7494 
7495 bool
7497  USART_MODULE_ID index ) ;
7498 //******************************************************************************
7499 /* Function:
7500  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7501  Summary:
7502  Identifies whether the ReceiverFramingError feature exists on the USART module.
7503  Description:
7504  This function identifies whether the ReceiverFramingError feature is
7505  available on the USART module. When this function returns true, this
7506  function is supported on the device:
7507  - PLIB_USART_ReceiverFramingErrorHasOccurred
7508  This operation is atomic.
7509  Preconditions:
7510  None.
7511  Parameters:
7512  index - Identifier for the device instance
7513  Returns:
7514  - true - The ReceiverFramingError feature is supported on the device
7515  - false - The ReceiverFramingError feature is not supported on the device
7516  Remarks:
7517  None.
7518 */
7519 
7520 bool
7522  USART_MODULE_ID index ) ;
7523 //******************************************************************************
7524 /* Function:
7525  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7526  Summary:
7527  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7528  Description:
7529  This function identifies whether the ReceiverInterruptMode feature is
7530  available on the USART module. When this function returns true, this
7531  function is supported on the device:
7532  - PLIB_USART_ReceiverInterruptModeSelect
7533  This operation is atomic.
7534  Preconditions:
7535  None.
7536  Parameters:
7537  index - Identifier for the device instance
7538  Returns:
7539  - true - The ReceiverInterruptMode feature is supported on the device
7540  - false - The ReceiverInterruptMode feature is not supported on the device
7541  Remarks:
7542  None.
7543 */
7544 
7545 bool
7547  USART_MODULE_ID index ) ;
7548 //******************************************************************************
7549 /* Function:
7550  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7551  Summary:
7552  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7553  Description:
7554  This function identifies whether the ReceiverPolarityInvert feature is
7555  available on the USART module. When this function returns true, these
7556  functions are supported on the device:
7557  - PLIB_USART_ReceiverIdleStateLowEnable
7558  - PLIB_USART_ReceiverIdleStateLowDisable
7559  This operation is atomic.
7560  Preconditions:
7561  None.
7562  Parameters:
7563  index - Identifier for the device instance
7564  Returns:
7565  - true - The ReceiverPolarityInvert feature is supported on the device
7566  - false - The ReceiverPolarityInvert feature is not supported on the device
7567  Remarks:
7568  None.
7569 */
7570 
7571 bool
7573  USART_MODULE_ID index ) ;
7574 //******************************************************************************
7575 /* Function:
7576  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7577  Summary:
7578  Identifies whether the ReceiverParityError feature exists on the USART module.
7579  Description:
7580  This function identifies whether the ReceiverParityError feature is
7581  available on the USART module. When this function returns true, this
7582  function is supported on the device:
7583  - PLIB_USART_ReceiverParityErrorHasOccurred
7584  This operation is atomic.
7585  Preconditions:
7586  None.
7587  Parameters:
7588  index - Identifier for the device instance
7589  Returns:
7590  - true - The ReceiverParityError feature is supported on the device
7591  - false - The ReceiverParityError feature is not supported on the device
7592  Remarks:
7593  None.
7594 */
7595 
7596 bool
7598  USART_MODULE_ID index ) ;
7599 //******************************************************************************
7600 /* Function:
7601  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7602  Summary:
7603  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7604  Description:
7605  This function identifies whether the ReceiverOverrunError feature is
7606  available on the USART module. When this function returns true, these
7607  functions are supported on the device:
7608  - PLIB_USART_ReceiverOverrunErrorClear
7609  - PLIB_USART_ReceiverOverrunHasOccurred
7610  This operation is atomic.
7611  Preconditions:
7612  None.
7613  Parameters:
7614  index - Identifier for the device instance
7615  Returns:
7616  - true - The ReceiverOverrunError feature is supported on the device
7617  - false - The ReceiverOverrunError feature is not supported on the device
7618  Remarks:
7619  None.
7620 */
7621 
7622 bool
7624  USART_MODULE_ID index ) ;
7625 //******************************************************************************
7626 /* Function:
7627  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7628  Summary:
7629  Identifies whether the Transmitter feature exists on the USART module.
7630  Description:
7631  This function identifies whether the Transmitter feature is
7632  available on the USART module. When this function returns true, these
7633  functions are supported on the device:
7634  - PLIB_USART_TransmitterByteSend
7635  - PLIB_USART_TransmitterAddressGet
7636  This operation is atomic.
7637  Preconditions:
7638  None.
7639  Parameters:
7640  index - Identifier for the device instance
7641  Returns:
7642  - true - The Transmitter feature is supported on the device
7643  - false - The Transmitter feature is not supported on the device
7644  Remarks:
7645  None.
7646 */
7647 
7648 bool
7650  USART_MODULE_ID index ) ;
7651 //******************************************************************************
7652 /* Function:
7653  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7654  Summary:
7655  Identifies whether the Transmitter9Bits feature exists on the USART module.
7656  Description:
7657  This function identifies whether the Transmitter9Bits feature is
7658  available on the USART module. When this function returns true, this
7659  function is supported on the device:
7660  - PLIB_USART_Transmitter9BitsSend
7661  This operation is atomic.
7662  Preconditions:
7663  None.
7664  Parameters:
7665  index - Identifier for the device instance
7666  Returns:
7667  - true - The Transmitter9Bits feature is supported on the device
7668  - false - The Transmitter9Bits feature is not supported on the device
7669  Remarks:
7670  None.
7671 */
7672 
7673 bool
7675  USART_MODULE_ID index ) ;
7676 //******************************************************************************
7677 /* Function:
7678  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7679  Summary:
7680  Identifies whether the TransmitterBreak feature exists on the USART module.
7681  Description:
7682  This function identifies whether the TransmitterBreak feature is
7683  available on the USART module. When this function returns true, these
7684  functions are supported on the device:
7685  - PLIB_USART_TransmitterBreakSend
7686  - PLIB_USART_TransmitterBreakSendIsComplete
7687  This operation is atomic.
7688  Preconditions:
7689  None.
7690  Parameters:
7691  index - Identifier for the device instance
7692  Returns:
7693  - true - The TransmitterBreak feature is supported on the device
7694  - false - The TransmitterBreak feature is not supported on the device
7695  Remarks:
7696  None.
7697 */
7698 
7699 bool
7701  USART_MODULE_ID index ) ;
7702 //******************************************************************************
7703 /* Function:
7704  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7705  Summary:
7706  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7707  Description:
7708  This function identifies whether the TransmitterBufferFull feature is
7709  available on the USART module. When this function returns true, this
7710  function is supported on the device:
7711  - PLIB_USART_TransmitterBufferIsFull
7712  This operation is atomic.
7713  Preconditions:
7714  None.
7715  Parameters:
7716  index - Identifier for the device instance
7717  Returns:
7718  - true - The TransmitterBufferFull feature is supported on the device
7719  - false - The TransmitterBufferFull feature is not supported on the device
7720  Remarks:
7721  None.
7722 */
7723 
7724 bool
7726  USART_MODULE_ID index ) ;
7727 //******************************************************************************
7728 /* Function:
7729  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7730  Summary:
7731  Identifies whether the TransmitterEmpty feature exists on the USART module.
7732  Description:
7733  This function identifies whether the TransmitterEmpty feature is
7734  available on the USART module. When this function returns true, this
7735  function is supported on the device:
7736  - PLIB_USART_TransmitterIsEmpty
7737  This operation is atomic.
7738  Preconditions:
7739  None.
7740  Parameters:
7741  index - Identifier for the device instance
7742  Returns:
7743  - true - The TransmitterEmpty feature is supported on the device
7744  - false - The TransmitterEmpty feature is not supported on the device
7745  Remarks:
7746  None.
7747 */
7748 
7749 bool
7751  USART_MODULE_ID index ) ;
7752 //******************************************************************************
7753 /* Function:
7754  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7755  Summary:
7756  Identifies whether the TransmitterEnableControl feature exists on the USART
7757  module
7758  Description:
7759  This function identifies whether the TransmitterEnableControl feature is
7760  available on the USART module. When this function returns true, these
7761  functions are supported on the device:
7762  - PLIB_USART_TransmitterEnable
7763  - PLIB_USART_TransmitterDisable
7764  This operation is atomic.
7765  Preconditions:
7766  None.
7767  Parameters:
7768  index - Identifier for the device instance
7769  Returns:
7770  - true - The TransmitterEnableControl feature is supported on the device
7771  - false - The TransmitterEnableControl feature is not supported on the device
7772  Remarks:
7773  None.
7774 */
7775 
7776 bool
7778  USART_MODULE_ID index ) ;
7779 //******************************************************************************
7780 /* Function:
7781  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7782  Summary:
7783  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7784  Description:
7785  This function identifies whether the TransmitterInterruptMode feature is
7786  available on the USART module. When this function returns true, this function
7787  is supported on the device:
7788  - PLIB_USART_TransmitterInterruptModeSelect
7789  This operation is atomic.
7790  Preconditions:
7791  None.
7792  Parameters:
7793  index - Identifier for the device instance
7794  Returns:
7795  - true - The TransmitterInterruptMode feature is supported on the device
7796  - false - The TransmitterInterruptMode feature is not supported on the device
7797  Remarks:
7798  None.
7799 */
7800 
7801 bool
7803  USART_MODULE_ID index ) ;
7804 //******************************************************************************
7805 /* Function:
7806  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7807  Summary:
7808  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7809  Description:
7810  This function identifies whether the TransmitterIdleIsLow feature is available
7811  on the USART module. When this function returns true, these functions are
7812  supported on the device:
7813  - PLIB_USART_TransmitterIdleIsLowDisable
7814  - PLIB_USART_TransmitterIdleIsLowEnable
7815  This operation is atomic.
7816  Preconditions:
7817  None.
7818  Parameters:
7819  index - Identifier for the device instance
7820  Returns:
7821  - true - The TransmitterIdleIsLow feature is supported on the device
7822  - false - The TransmitterIdleIsLow feature is not supported on the device
7823  Remarks:
7824  None.
7825 */
7826 
7827 bool
7829  USART_MODULE_ID index ) ;
7830 //DOM-IGNORE-BEGIN
7831 //DOM-IGNORE-END
7832  // #ifndef _PLIB_USART_H
7833 /******************************************************************************
7834  End of File
7835 */
7836 
7837 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7838 /* CLOSE_FILE Include File */
7839 
7840 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7841 /*******************************************************************************
7842  System Services Library Interface Header
7843  Company:
7844  Microchip Technology Inc.
7845  File Name:
7846  system.h
7847  Summary:
7848  Top level common system services library interface header.
7849  Description:
7850  This file is the top level common system services library interface header.
7851  It defines (or includes files that define) the common system service
7852  types, prototypes, and other definitions that are commonly used by MPLAB
7853  Harmony libraries and system services.
7854 
7855  System services provide common functionality that would otherwise need to
7856  be duplicated by multiple other modules or that would force them to
7857  interact in complex and hard to manage ways. System services eliminate
7858  conflicts by controlling access shared resources.
7859  Remarks:
7860  The parent directory to the "system" directory should be added to the
7861  compiler's search path for header files such that the following include
7862  statment will successfully include this file.
7863 
7864 #include "system/system.h"
7865  *******************************************************************************/
7866 //DOM-IGNORE-BEGIN
7867 /*******************************************************************************
7868 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7869 Microchip licenses to you the right to use, modify, copy and distribute
7870 Software only when embedded on a Microchip microcontroller or digital signal
7871 controller that is integrated into your product or third party product
7872 (pursuant to the sublicense terms in the accompanying license agreement).
7873 You should refer to the license agreement accompanying this Software for
7874 additional information regarding your rights and obligations.
7875 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7876 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7877 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7878 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7879 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7880 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7881 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7882 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7883 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7884 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7885  *******************************************************************************/
7886 //DOM-IGNORE-END
7887 #ifndef _SYSTEM_H
7888 #define _SYSTEM_H
7889 // *****************************************************************************
7890 // *****************************************************************************
7891 // Section: Included Files
7892 // *****************************************************************************
7893 // *****************************************************************************
7894 #include "system/common/sys_common.h"
7895 #include "system/common/sys_module.h"
7896 // DOM-IGNORE-BEGIN
7897 // DOM-IGNORE-END
7898 //DOM-IGNORE-BEGIN
7899 //DOM-IGNORE-END
7900  // _SYSTEM_H
7901 /*******************************************************************************
7902  End of File
7903 */
7904 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7905 /* CLOSE_FILE Include File */
7906 
7907 #include "system/int/sys_int.h"
7908 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7909 /*******************************************************************************
7910  DMA System Service Library Interface Definition
7911  Company:
7912  Microchip Technology Inc.
7913  File Name:
7914  sys_dma.h
7915  Summary:
7916  DMA System Service.
7917  Description:
7918  This file contains the interface definition for the DMA System
7919  Service. It provides a way to interact with the DMA subsystem to
7920  manage the data transfer between different peripherals and/or memory
7921  without intervention from the CPU.
7922 *******************************************************************************/
7923 //DOM-IGNORE-BEGIN
7924 /*******************************************************************************
7925 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7926 Microchip licenses to you the right to use, modify, copy and distribute
7927 Software only when embedded on a Microchip microcontroller or digital signal
7928 controller that is integrated into your product or third party product
7929 (pursuant to the sublicense terms in the accompanying license agreement).
7930 You should refer to the license agreement accompanying this Software for
7931 additional information regarding your rights and obligations.
7932 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7933 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7934 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7935 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7936 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7937 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7938 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7939 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7940 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7941 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7942 *******************************************************************************/
7943 //DOM-IGNORE-END
7944 #ifndef _SYS_DMA_H
7945 #define _SYS_DMA_H
7946 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7947 /*******************************************************************************
7948  DMA System Service Library Interface Definition
7949  Company:
7950  Microchip Technology Inc.
7951  File Name:
7952  sys_dma_definitions.h
7953  Summary:
7954  DMA System Service data type definitions header.
7955  Description:
7956  This file contains data type definitions header.
7957 *******************************************************************************/
7958 //DOM-IGNORE-BEGIN
7959 /*******************************************************************************
7960 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7961 Microchip licenses to you the right to use, modify, copy and distribute
7962 Software only when embedded on a Microchip microcontroller or digital signal
7963 controller that is integrated into your product or third party product
7964 (pursuant to the sublicense terms in the accompanying license agreement).
7965 You should refer to the license agreement accompanying this Software for
7966 additional information regarding your rights and obligations.
7967 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7968 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7969 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7970 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7971 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7972 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7973 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7974 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7975 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7976 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7977 *******************************************************************************/
7978 //DOM-IGNORE-END
7979 #ifndef _SYS_DMA_DEFINITIONS_H
7980 #define _SYS_DMA_DEFINITIONS_H
7981 // *****************************************************************************
7982 // *****************************************************************************
7983 // Section: File includes
7984 // *****************************************************************************
7985 // *****************************************************************************
7986 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7987 #include "system/common/sys_common.h"
7988 #include "system/common/sys_module.h"
7989 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7990 /*******************************************************************************
7991  DMA Peripheral Library Interface Header
7992  Company:
7993  Microchip Technology Inc.
7994  File Name:
7995  plib_dma.h
7996  Summary:
7997  Defines the DMA Peripheral Library interface functions.
7998  Description:
7999  This header file contains the function prototypes and definitions of
8000  the data types and constants that make up the interface to the Direct Memory
8001  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8002  definitions in this file are for the DMA module.
8003 *******************************************************************************/
8004 // DOM-IGNORE-BEGIN
8005 /*******************************************************************************
8006 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8007 Microchip licenses to you the right to use, modify, copy and distribute
8008 Software only when embedded on a Microchip microcontroller or digital signal
8009 controller that is integrated into your product or third party product
8010 (pursuant to the sublicense terms in the accompanying license agreement).
8011 You should refer to the license agreement accompanying this Software for
8012 additional information regarding your rights and obligations.
8013 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8014 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8015 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8016 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8017 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8018 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8019 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8020 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8021 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8022 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8023 *******************************************************************************/
8024 // DOM-IGNORE-END
8025 #ifndef _PLIB_DMA_H
8026 #define _PLIB_DMA_H
8027 // DOM-IGNORE-BEGIN
8028 // DOM-IGNORE-END
8029 // *****************************************************************************
8030 // *****************************************************************************
8031 // Section: Includes
8032 // *****************************************************************************
8033 // *****************************************************************************
8034 /* See Bottom of file for implementation header include files.
8035 */
8036 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8037 //DOM-IGNORE-BEGIN
8038 /*******************************************************************************
8039 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8040 Microchip licenses to you the right to use, modify, copy and distribute
8041 Software only when embedded on a Microchip microcontroller or digital signal
8042 controller that is integrated into your product or third party product
8043 (pursuant to the sublicense terms in the accompanying license agreement).
8044 You should refer to the license agreement accompanying this Software for
8045 additional information regarding your rights and obligations.
8046 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8047 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8048 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8049 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8050 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8051 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8052 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8053 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8054 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8055 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8056  *******************************************************************************/
8057 //DOM-IGNORE-END
8058 #ifndef _PLIB_DMA_PROCESSOR_H
8059 #define _PLIB_DMA_PROCESSOR_H
8060 #error "Can't find header"
8061 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8062 /* CLOSE_FILE Include File */
8063 
8064 // *****************************************************************************
8065 // *****************************************************************************
8066 // Section: Peripheral Library Interface Functions
8067 // *****************************************************************************
8068 // *****************************************************************************
8069 // *****************************************************************************
8070 // *****************************************************************************
8071 // Section: DMA Channel Status Functions
8072 // *****************************************************************************
8073 // *****************************************************************************
8074 //******************************************************************************
8075 /* Function:
8076  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8077  DMA_CHANNEL channel )
8078  Summary:
8079  Returns the buffered data write status for the specified channel.
8080  Description:
8081  This function returns the buffered data write status for the specified channel.
8082  Precondition:
8083  None.
8084  Parameters:
8085  channel - One of the existing DMA channels listed by DMA_CHANNEL
8086  Returns:
8087  - true - The content of the DMA buffer has not been written to the location
8088  specified in the destination/source address or in Null Write mode
8089  - false - The content of the DMA buffer has been written to the location
8090  specified in the destination/source address or in Null Write mode
8091  Example:
8092  <code>
8093  bool chBuffWriteStatus;
8094  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8095  DMA_CHANNEL_3 );
8096  </code>
8097  Remarks:
8098  This feature is not available on all devices. Please refer to the specific device
8099  data sheet to determine availability.
8100 */
8101 
8102 bool
8104  DMA_MODULE_ID index ,
8105  DMA_CHANNEL channel ) ;
8106 /*******************************************************************************
8107  Function:
8108  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8109  DMA_CHANNEL channel,
8110  DMA_CHANNEL_COLLISION collisonType )
8111  Summary:
8112  Returns the status of the specified collision type for the specified channel.
8113  Description:
8114  This function returns the status of the specified collision type for the
8115  specified channel.
8116  Precondition:
8117  None.
8118  Parameters:
8119  channel - One of the existing DMA channels listed by DMA_CHANNEL
8120  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8121  Returns:
8122  - true - A collision specified by collisonType was detected
8123  - false - No collision of type collisonType was detected
8124  Example:
8125  <code>
8126  bool memWriteCollisionStatus;
8127  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8128  DMA_ID_0,
8129  DMA_CHANNEL_3,
8130  DMA_CHANNEL_COLLISION_MEMORY );
8131  </code>
8132  Remarks:
8133  This feature is not available on all devices. Please refer to the specific
8134  device data sheet to determine availability.
8135 */
8136 
8137 bool
8139  DMA_MODULE_ID index ,
8140  DMA_CHANNEL channel ,
8141  DMA_CHANNEL_COLLISION collisonType ) ;
8142 //******************************************************************************
8143 /* Function:
8144  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8145  DMA_CHANNEL channel )
8146  Summary:
8147  Returns the Ping-Pong mode status for the specified channel.
8148  Description:
8149  This function returns the Ping-Pong mode status for the specified channel.
8150  Precondition:
8151  None.
8152  Parameters:
8153  channel - One of the existing DMA channels listed by DMA_CHANNEL
8154  Returns:
8155  mode - One of the possible Ping-Pong modes
8156  Example:
8157  <code>
8158  DMA_PING_PONG_MODE chPingPongStatus;
8159  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8160  DMA_CHANNEL_3 );
8161  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8162  {
8163  \\Application
8164  }
8165  </code>
8166  Remarks:
8167  This feature is not available on all devices. Please refer to the specific
8168  device data sheet to determine availability.
8169 */
8170 
8171 DMA_PING_PONG_MODE
8173  DMA_MODULE_ID index ,
8174  DMA_CHANNEL channel ) ;
8175 //******************************************************************************
8176 /* Function:
8177  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8178  DMA_CHANNEL channel )
8179  Summary:
8180  Returns the event status on the specified channel.
8181  Description:
8182  This function returns the event status on the specified channel.
8183  Precondition:
8184  None.
8185  Parameters:
8186  channel - One of the possible DMA channels listed by DMA_CHANNEL
8187  Returns:
8188  - true - An event was detected
8189  - false - No events were detected
8190  Example:
8191  <code>
8192  bool channeleventStatus;
8193  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8194  DMA_CHANNEL_2 );
8195  </code>
8196  Remarks:
8197  This function implements an operation of the ChannelXEvent feature.
8198  This feature may not be available on all devices. Please refer to the
8199  specific device data sheet to determine availability or include the
8200  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8201  whether this feature is available.
8202 */
8203 
8204 bool
8206  DMA_MODULE_ID index ,
8207  DMA_CHANNEL channel ) ;
8208 // *****************************************************************************
8209 // *****************************************************************************
8210 // Section: DMA Channel Configuration Functions
8211 // *****************************************************************************
8212 // *****************************************************************************
8213 //******************************************************************************
8214 /* Function:
8215  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8216  DMA_CHANNEL channel,
8217  DMA_CHANNEL_PRIORITY channelPriority )
8218  Summary:
8219  Sets the priority of the specified channel.
8220  Description:
8221  This function sets the priority of the specified channel.
8222  Precondition:
8223  None.
8224  Parameters:
8225  channel - One of the existing DMA channels listed by DMA_CHANNEL
8226  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8227  Returns:
8228  None.
8229  Example:
8230  <code>
8231  DMA_CHANNEL channel = DMA_CHANNEL_0;
8232  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8233  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8234  </code>
8235  Remarks:
8236  This function implements an operation of the ChannelXPriority feature.
8237  This feature may not be available on all devices. Please refer to the
8238  specific device data sheet to determine availability or use the
8239  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8240  whether this feature is available.
8241 */
8242 
8243 void
8245  DMA_MODULE_ID index ,
8246  DMA_CHANNEL channel ,
8247  DMA_CHANNEL_PRIORITY channelPriority ) ;
8248 //******************************************************************************
8249 /* Function:
8250  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8251  DMA_CHANNEL channel )
8252  Summary:
8253  Gets the priority of the specified channel.
8254  Description:
8255  This function gets the priority of the specified channel.
8256  Precondition:
8257  None.
8258  Parameters:
8259  channel - One of the existing DMA channels listed by DMA_CHANNEL
8260  Returns:
8261  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8262  Example:
8263  <code>
8264  DMA_CHANNEL channel = DMA_CHANNEL_0;
8265  DMA_CHANNEL_PRIORITY channelPriority;
8266  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8267  </code>
8268  Remarks:
8269  This function implements an operation of the ChannelXPriority feature.
8270  This feature may not be available on all devices. Please refer to the
8271  specific device data sheet to determine availability or use the
8272  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8273  whether this feature is available.
8274 */
8275 
8276 DMA_CHANNEL_PRIORITY
8278  DMA_MODULE_ID index ,
8279  DMA_CHANNEL channel ) ;
8280 //******************************************************************************
8281 /* Function:
8282  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8283  DMA_CHANNEL_PRIORITY channelPriority )
8284  Summary:
8285  Sets the priority scheme of the DMA channels.
8286  Description:
8287  This function sets the priority scheme of the DMA channels at the global level.
8288  This function is used in devices that do not have the per channel priority feature.
8289  Precondition:
8290  None.
8291  Parameters:
8292  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8293  Returns:
8294  None.
8295  Example:
8296  <code>
8297  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8298  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8299  </code>
8300  Remarks:
8301  This feature is not available on all devices. Please refer to the specific
8302  device data sheet to determine availability.
8303 */
8304 
8305 void
8307  DMA_MODULE_ID index ,
8308  DMA_CHANNEL_PRIORITY channelPriority ) ;
8309 //******************************************************************************
8310 /* Function:
8311  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8312  Summary:
8313  Gets the priority scheme of the DMA channels.
8314  Description:
8315  This function gets the priority scheme of the DMA channels at the global level.
8316  This function is used in devices that do not have the per channel priority feature.
8317  Precondition:
8318  None.
8319  Parameters:
8320  None.
8321  Returns:
8322  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8323  Example:
8324  <code>
8325  DMA_CHANNEL_PRIORITY channelPriority;
8326  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8327  </code>
8328  Remarks:
8329  This feature is not available on all devices. Please refer to the specific
8330  device data sheet to determine availability.
8331 */
8332 
8333 DMA_CHANNEL_PRIORITY
8335  DMA_MODULE_ID index ) ;
8336 //******************************************************************************
8337 /* Function:
8338  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8339  DMA_CHANNEL channel )
8340  Summary:
8341  Channel is continuously enabled.
8342  Description:
8343  This function enables the channel continuously. The channel is not automatically
8344  disabled after a block transfer is complete.
8345  Precondition:
8346  None.
8347  Parameters:
8348  channel - One of the possible DMA channels listed by DMA_CHANNEL
8349  Returns:
8350  None.
8351  Example:
8352  <code>
8353  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8354  </code>
8355  Remarks:
8356  This function implements an operation of the ChannelXAuto feature.
8357  This feature may not be available on all devices. Please refer to the
8358  specific device data sheet to determine availability or use the
8359  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8360  whether this feature is available.
8361 */
8362 
8363 void
8365  DMA_MODULE_ID index ,
8366  DMA_CHANNEL channel ) ;
8367 //******************************************************************************
8368 /* Function:
8369  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8370  DMA_CHANNEL channel )
8371  Summary:
8372  Returns the channel automatic enable status.
8373  Description:
8374  This function returns the channel automatic enable status.
8375  Precondition:
8376  None.
8377  Parameters:
8378  channel - One of the possible DMA channels listed by DMA_CHANNEL
8379  Returns:
8380  - true - Channel automatic enable is on
8381  - false - Channel automatic enable is off
8382  Example:
8383  <code>
8384  bool ChAutoEnableStatus;
8385  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8386  </code>
8387  Remarks:
8388  This function implements an operation of the ChannelXAuto feature.
8389  This feature may not be available on all devices. Please refer to the
8390  specific device data sheet to determine availability or use the
8391  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8392  whether this feature is available.
8393 */
8394 
8395 bool
8397  DMA_MODULE_ID index ,
8398  DMA_CHANNEL channel ) ;
8399 //******************************************************************************
8400 /* Function:
8401  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8402  DMA_CHANNEL channel )
8403  Summary:
8404  Channel is disabled after a block transfer is complete.
8405  Description:
8406  This function disables a channel after a block transfer is complete.
8407  Precondition:
8408  None.
8409  Parameters:
8410  channel - One of the possible DMA channels listed by DMA_CHANNEL
8411  Returns:
8412  None.
8413  Example:
8414  <code>
8415  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8416  </code>
8417  Remarks:
8418  This function implements an operation of the ChannelXAuto feature.
8419  This feature may not be available on all devices. Please refer to the
8420  specific device data sheet to determine availability or use the
8421  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8422  whether this feature is available.
8423 */
8424 
8425 void
8427  DMA_MODULE_ID index ,
8428  DMA_CHANNEL channel ) ;
8429 //******************************************************************************
8430 /* Function:
8431  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8432  DMA_CHANNEL channel )
8433  Summary:
8434  Channel chain feature is enabled.
8435  Description:
8436  This function enables the channel chain feature.
8437  Precondition:
8438  None.
8439  Parameters:
8440  channel - One of the possible DMA channels listed by DMA_CHANNEL
8441  Returns:
8442  None.
8443  Example:
8444  <code>
8445  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8446  </code>
8447  Remarks:
8448  This function implements an operation of the ChannelXChainEnbl feature.
8449  This feature may not be available on all devices. Please refer to the
8450  specific device data sheet to determine availability or use the
8451  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8452  whether this feature is available.
8453 */
8454 
8455 void
8457  DMA_MODULE_ID index ,
8458  DMA_CHANNEL channel ) ;
8459 //******************************************************************************
8460 /* Function:
8461  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8462  DMA_CHANNEL channel )
8463  Summary:
8464  Returns the chain status of the specified channel.
8465  Description:
8466  This function returns the chain status of the specified channel.
8467  Precondition:
8468  None.
8469  Parameters:
8470  channel - One of the possible DMA channels listed by DMA_CHANNEL
8471  Returns:
8472  - true - The channel chain is on for this channel
8473  - false - The channel chain is off for this channel
8474  Example:
8475  <code>
8476  bool ChchainStatus;
8477  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8478  </code>
8479  Remarks:
8480  This function implements an operation of the ChannelXChainEnbl feature.
8481  This feature may not be available on all devices. Please refer to the
8482  specific device data sheet to determine availability or use the
8483  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8484  whether this feature is available.
8485 */
8486 
8487 bool
8489  DMA_MODULE_ID index ,
8490  DMA_CHANNEL channel ) ;
8491 //******************************************************************************
8492 /* Function:
8493  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8494  DMA_CHANNEL channel )
8495  Summary:
8496  Disables the channel chaining for the specified DMA channel.
8497  Description:
8498  This function disables the channel chaining for the specified DMA channel.
8499  Precondition:
8500  None.
8501  Parameters:
8502  channel - One of the possible DMA channels listed by DMA_CHANNEL
8503  Returns:
8504  None.
8505  Example:
8506  <code>
8507  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8508  </code>
8509  Remarks:
8510  This function implements an operation of the ChannelXChainEnbl feature.
8511  This feature may not be available on all devices. Please refer to the
8512  specific device data sheet to determine availability or use the
8513  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8514  whether this feature is available.
8515 */
8516 
8517 void
8519  DMA_MODULE_ID index ,
8520  DMA_CHANNEL channel ) ;
8521 //******************************************************************************
8522 /* Function:
8523  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8524  DMA_CHANNEL channel )
8525  Summary:
8526  Channel start/abort events will be registered even if the channel is
8527  disabled.
8528  Description:
8529  This function will allow the channel register start/abort events even if the
8530  channel is disabled.
8531  Precondition:
8532  None.
8533  Parameters:
8534  channel - One of the possible DMA channels listed by DMA_CHANNEL
8535  Returns:
8536  None.
8537  Example:
8538  <code>
8539  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8540  </code>
8541  Remarks:
8542  This function implements an operation of the ChannelXDisabled feature.
8543  This feature may not be available on all devices. Please refer to the
8544  specific device data sheet to determine availability or use the
8545  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8546  determine whether this feature is available.
8547 */
8548 
8549 void
8551  DMA_MODULE_ID index ,
8552  DMA_CHANNEL channel ) ;
8553 //******************************************************************************
8554 /* Function:
8555  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8556  DMA_CHANNEL channel )
8557  Summary:
8558  Channel start/abort events will be ignored even if the channel is
8559  disabled.
8560  Description:
8561  This function will allow the channel start/abort events to be ignored even if
8562  the channel is disabled.
8563  Precondition:
8564  None.
8565  Parameters:
8566  channel - One of the possible DMA channels listed by DMA_CHANNEL
8567  Returns:
8568  None.
8569  Example:
8570  <code>
8571  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8572  </code>
8573  Remarks:
8574  This function implements an operation of the ChannelXDisabled feature.
8575  This feature may not be available on all devices. Please refer to the
8576  specific device data sheet to determine availability or use the
8577  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8578  determine whether this feature is available.
8579 */
8580 
8581 void
8583  DMA_MODULE_ID index ,
8584  DMA_CHANNEL channel ) ;
8585 //******************************************************************************
8586 /* Function:
8587  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8588  DMA_CHANNEL channel )
8589  Summary:
8590  Enable the specified channel.
8591  Description:
8592  This function will enable the specified channel.
8593  Precondition:
8594  None.
8595  Parameters:
8596  channel - One of the possible DMA channels listed by DMA_CHANNEL
8597  Returns:
8598  None.
8599  Example:
8600  <code>
8601  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8602  </code>
8603  Remarks:
8604  This function implements an operation of the ChannelX feature.
8605  This feature may not be available on all devices. Please refer to the
8606  specific device data sheet to determine availability or use the
8607  PLIB_DMA_ExistsChannelX function in your application to automatically
8608  determine whether this feature is available.
8609 */
8610 
8611 void
8613  DMA_MODULE_ID index ,
8614  DMA_CHANNEL channel ) ;
8615 //******************************************************************************
8616 /* Function:
8617  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8618  DMA_CHANNEL channel )
8619  Summary:
8620  Return the enable status of the specified channel.
8621  Description:
8622  This function will return the enable status of the specified channel.
8623  Precondition:
8624  None.
8625  Parameters:
8626  channel - One of the possible DMA channels listed by DMA_CHANNEL
8627  Returns:
8628  - true - The specified DMA channel is enabled
8629  - false - The specified DMA channel is disabled
8630  Example:
8631  <code>
8632  bool chEnableStatus;
8633  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8634  </code>
8635  Remarks:
8636  This function implements an operation of the ChannelX feature.
8637  This feature may not be available on all devices. Please refer to the
8638  specific device data sheet to determine availability or use the
8639  PLIB_DMA_ExistsChannelX function in your application to automatically
8640  determine whether this feature is available.
8641 */
8642 
8643 bool
8645  DMA_MODULE_ID index ,
8646  DMA_CHANNEL channel ) ;
8647 //******************************************************************************
8648 /* Function:
8649  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8650  DMA_CHANNEL channel )
8651  Summary:
8652  Disable the specified channel.
8653  Description:
8654  This function will disable the specified channel.
8655  Precondition:
8656  None.
8657  Parameters:
8658  channel - One of the possible DMA channels listed by DMA_CHANNEL
8659  Returns:
8660  None.
8661  Example:
8662  <code>
8663  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8664  </code>
8665  Remarks:
8666  This function implements an operation of the ChannelX feature.
8667  This feature may not be available on all devices. Please refer to the
8668  specific device data sheet to determine availability or use the
8669  PLIB_DMA_ExistsChannelX function in your application to automatically
8670  determine whether this feature is available.
8671 */
8672 
8673 void
8675  DMA_MODULE_ID index ,
8676  DMA_CHANNEL channel ) ;
8677 //******************************************************************************
8678 /* Function:
8679  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8680  DMA_CHANNEL channel )
8681  Summary:
8682  Chains the specified channel to a channel lower in natural priority.
8683  Description:
8684  This function will chain the specified channel to a channel lower in
8685  natural priority. CH3 will be enabled by a CH4 transfer complete.
8686  Precondition:
8687  None.
8688  Parameters:
8689  channel - One of the possible DMA channels listed by DMA_CHANNEL
8690  Returns:
8691  None.
8692  Example:
8693  <code>
8694  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8695  </code>
8696  Remarks:
8697  This function implements an operation of the ChannelXChain feature.
8698  This feature may not be available on all devices. Please refer to the
8699  specific device data sheet to determine availability or use the
8700  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8701  determine whether this feature is available.
8702 */
8703 
8704 void
8706  DMA_MODULE_ID index ,
8707  DMA_CHANNEL channel ) ;
8708 //******************************************************************************
8709 /* Function:
8710  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8711  DMA_CHANNEL channel )
8712  Summary:
8713  Chains the specified channel to a channel higher in natural priority.
8714  Description:
8715  This function will chain the specified channel to a channel higher in
8716  natural priority. CH5 will be enabled by a CH4 transfer complete.
8717  Precondition:
8718  None.
8719  Parameters:
8720  channel - One of the possible DMA channels listed by DMA_CHANNEL
8721  Returns:
8722  None.
8723  Example:
8724  <code>
8725  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8726  </code>
8727  Remarks:
8728  This function implements an operation of the ChannelXChain feature.
8729  This feature may not be available on all devices. Please refer to the
8730  specific device data sheet to determine availability or use the
8731  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8732  determine whether this feature is available.
8733 */
8734 
8735 void
8737  DMA_MODULE_ID index ,
8738  DMA_CHANNEL channel ) ;
8739 //******************************************************************************
8740 /* Function:
8741  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8742  DMA_CHANNEL channel )
8743  Summary:
8744  Sets the Busy bit to active.
8745  Description:
8746  This function sets the Busy bit to active, indicating the channel is active
8747  or has been enabled.
8748  Precondition:
8749  None.
8750  Parameters:
8751  channel - One of the possible DMA channels listed by DMA_CHANNEL
8752  Returns:
8753  None.
8754  Example:
8755  <code>
8756  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8757  </code>
8758  Remarks:
8759  This function implements an operation of the ChannelXBusy feature.
8760  This feature may not be available on all devices. Please refer to the
8761  specific device data sheet to determine availability or use the
8762  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8763  determine whether this feature is available.
8764 */
8765 
8766 void
8768  DMA_MODULE_ID index ,
8769  DMA_CHANNEL channel ) ;
8770 //******************************************************************************
8771 /* Function:
8772  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8773  DMA_CHANNEL channel )
8774  Summary:
8775  Sets the Busy bit to inactive.
8776  Description:
8777  This function sets the Busy bit to inactive, indicating the channel is inactive
8778  or has been disabled.
8779  Precondition:
8780  None.
8781  Parameters:
8782  channel - One of the possible DMA channels listed by DMA_CHANNEL
8783  Returns:
8784  None.
8785  Example:
8786  <code>
8787  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8788  </code>
8789  Remarks:
8790  This function implements an operation of the ChannelXBusy feature.
8791  This feature may not be available on all devices. Please refer to the
8792  specific device data sheet to determine availability or use the
8793  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8794  determine whether this feature is available.
8795 */
8796 
8797 void
8799  DMA_MODULE_ID index ,
8800  DMA_CHANNEL channel ) ;
8801 //******************************************************************************
8802 /* Function:
8803  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8804  DMA_CHANNEL channel )
8805  Summary:
8806  Returns the busy status of the specified channel.
8807  Description:
8808  This function returns the busy status of the specified channel.
8809  Precondition:
8810  None.
8811  Parameters:
8812  channel - One of the possible DMA channels listed by DMA_CHANNEL
8813  Returns:
8814  - true - The channel is active or has been enabled
8815  - false - The channel is inactive or has been disabled
8816  Example:
8817  <code>
8818  bool chBusyStatus;
8819  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8820  </code>
8821  Remarks:
8822  This function implements an operation of the ChannelXBusy feature.
8823  This feature may not be available on all devices. Please refer to the
8824  specific device data sheet to determine availability or use the
8825  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8826  determine whether this feature is available.
8827 */
8828 
8829 bool
8831  DMA_MODULE_ID index ,
8832  DMA_CHANNEL channel ) ;
8833 //******************************************************************************
8834 /* Function:
8835  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8836  DMA_CHANNEL channel,
8837  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8838  Summary:
8839  Selects the data transfer direction of the specified channel.
8840  Description:
8841  This function selects the data transfer direction of the specified channel.
8842  Precondition:
8843  None.
8844  Parameters:
8845  channel - One of the possible DMA channels listed by DMA_CHANNEL
8846  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8847  Returns:
8848  None.
8849  Example:
8850  <code>
8851  PLIB_DMA_ChannelXTransferDirectionSelect (
8852  DMA_ID_0,
8853  DMA_CHANNEL_4,
8854  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8855  </code>
8856  Remarks:
8857  This feature is not available on all devices. Please refer to the specific
8858  device data sheet to determine availability.
8859 */
8860 
8861 void
8863  DMA_MODULE_ID index ,
8864  DMA_CHANNEL channel ,
8865  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8866 //******************************************************************************
8867 /* Function:
8868  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8869  DMA_MODULE_ID index,
8870  DMA_CHANNEL channel)
8871  Summary:
8872  Returns the data transfer direction of the specified channel.
8873  Description:
8874  This function returns the data transfer direction of the specified channel.
8875  Precondition:
8876  None.
8877  Parameters:
8878  channel - One of the possible DMA channels listed by DMA_CHANNEL
8879  Returns:
8880  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8881  DMA_CHANNEL_TRANSFER_DIRECTION
8882  Example:
8883  <code>
8884  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8885  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8886  DMA_ID_0,
8887  DMA_CHANNEL_4 );
8888  </code>
8889  Remarks:
8890  This feature is not available on all devices. Please refer to the specific
8891  device data sheet to determine availability.
8892 */
8893 
8894 DMA_CHANNEL_TRANSFER_DIRECTION
8896  DMA_MODULE_ID index ,
8897  DMA_CHANNEL channel ) ;
8898 //******************************************************************************
8899 /* Function:
8900  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8901  DMA_CHANNEL channel ,
8902  uint16_t address,
8903  DMA_ADDRESS_OFFSET_TYPE offset )
8904  Summary:
8905  Sets the primary/secondary start address (DPSRAM) offset to the value
8906  specified depending on the offset type specified for the specified channel.
8907  Description:
8908  This function sets the primary/secondary start address (DPSRAM) offset to the value
8909  specified depending on the offset type specified for the specified channel.
8910  Precondition:
8911  None.
8912  Parameters:
8913  channel - One of the possible DMA channels listed by DMA_CHANNEL
8914  address - The primary/secondary DPSRAM start address offset
8915  offset - The type of the address offset (primary/secondary)
8916  Returns:
8917  None.
8918  Example:
8919  <code>
8920  uint16_t address = 0x100;
8921  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8922  DMA_CHANNEL_4,
8923  address,
8924  DMA_ADDRESS_OFFSET_PRIMARY );
8925  </code>
8926  Remarks:
8927  This feature is not available on all devices. Please refer to the specific
8928  device data sheet to determine availability.
8929 */
8930 
8931 void
8933  DMA_MODULE_ID index ,
8934  DMA_CHANNEL channel ,
8935  uint16_t address ,
8936  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8937 //******************************************************************************
8938 /* Function:
8939  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8940  DMA_CHANNEL channel,
8941  DMA_ADDRESS_OFFSET_TYPE offset)
8942  Summary:
8943  Gets the primary/secondary start address (DPSRAM) offset.
8944  Description:
8945  This function gets the primary/secondary start address (DPSRAM) offset.
8946  Precondition:
8947  None.
8948  Parameters:
8949  channel - One of the possible DMA channels listed by DMA_CHANNEL
8950  offset - The type of the address offset (primary/secondary)
8951  Returns:
8952  - uint16_t - The primary/secondary DPSRAM start address offset
8953  Example:
8954  <code>
8955  uint16_t addressOffsetA;
8956  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8957  DMA_ID_0,
8958  DMA_CHANNEL_4,
8959  address,
8960  DMA_ADDRESS_OFFSET_PRIMARY );
8961  </code>
8962  Remarks:
8963  This feature is not available on all devices. Please refer to the specific
8964  device data sheet to determine availability.
8965 */
8966 
8967 uint16_t
8969  DMA_MODULE_ID index ,
8970  DMA_CHANNEL channel ,
8971  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8972 //******************************************************************************
8973 /* Function:
8974  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8975  DMA_CHANNEL channel ,
8976  uint16_t peripheraladdress )
8977  Summary:
8978  Sets the peripheral address for the specified channel.
8979  Description:
8980  This function sets the peripheral address for the specified channel.
8981  Precondition:
8982  None.
8983  Parameters:
8984  channel - One of the possible DMA channels listed by DMA_CHANNEL
8985  peripheraladdress - The peripheral address for the specified channel
8986  Returns:
8987  None.
8988  Example:
8989  <code>
8990  uint16_t peripheraladdress = 0x100;
8991  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8992  DMA_CHANNEL_4,
8993  peripheraladdress );
8994  </code>
8995  Remarks:
8996  This feature is not available on all devices. Please refer to the specific
8997  device data sheet to determine availability.
8998 */
8999 
9000 void
9002  DMA_MODULE_ID index ,
9003  DMA_CHANNEL channel ,
9004  uint16_t peripheraladdress ) ;
9005 //******************************************************************************
9006 /* Function:
9007  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9008  DMA_CHANNEL channel )
9009  Summary:
9010  Gets the peripheral address configured for the specified channel.
9011  Description:
9012  This function gets the peripheral address configured for the specified channel.
9013  Precondition:
9014  None.
9015  Parameters:
9016  channel - One of the possible DMA channels listed by DMA_CHANNEL
9017  Returns:
9018  - uint16_t - The peripheral address configured for the specified channel
9019  Example:
9020  <code>
9021  uint16_t peripheraladdress;
9022  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9023  DMA_CHANNEL_4 );
9024  </code>
9025  Remarks:
9026  This feature is not available on all devices. Please refer to the specific
9027  device data sheet to determine availability.
9028 */
9029 
9030 uint16_t
9032  DMA_MODULE_ID index ,
9033  DMA_CHANNEL channel ) ;
9034 //******************************************************************************
9035 /* Function:
9036  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9037  DMA_CHANNEL channel ,
9038  uint16_t transferCount )
9039  Summary:
9040  Sets the DMA data transfer count for the specified channel.
9041  Description:
9042  This function sets the DMA data transfer count for the specified channel.
9043  Precondition:
9044  None.
9045  Parameters:
9046  channel - One of the possible DMA channels listed by DMA_CHANNEL
9047  transferCount - The DMA transfer count for the channel
9048  Returns:
9049  None.
9050  Example:
9051  <code>
9052  uint16_t transferCount = 0x10;
9053  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9054  DMA_CHANNEL_4,
9055  transferCount );
9056  </code>
9057  Remarks:
9058  This feature is not available on all devices. Please refer to the specific
9059  device data sheet to determine availability.
9060 */
9061 
9062 void
9064  DMA_MODULE_ID index ,
9065  DMA_CHANNEL channel ,
9066  uint16_t transferCount ) ;
9067 //******************************************************************************
9068 /* Function:
9069  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9070  DMA_CHANNEL channel )
9071  Summary:
9072  Gets the DMA data transfer count that is programmed for the specified channel.
9073  Description:
9074  This function gets the DMA data transfer count that is programmed for the specified channel.
9075  Precondition:
9076  None.
9077  Parameters:
9078  channel - One of the possible DMA channels listed by DMA_CHANNEL
9079  Returns:
9080  - uint16_t - The DMA transfer count for the channel
9081  Example:
9082  <code>
9083  uint16_t transferCount;
9084  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9085  DMA_CHANNEL_4 );
9086  </code>
9087  Remarks:
9088  This feature is not available on all devices. Please refer to the specific
9089  device data sheet to determine availability.
9090 */
9091 
9092 uint16_t
9094  DMA_MODULE_ID index ,
9095  DMA_CHANNEL channel ) ;
9096 //******************************************************************************
9097 /* Function:
9098  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9099  DMA_MODULE_ID index,
9100  DMA_CHANNEL channel,
9101  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9102  Summary:
9103  Sets the source address mode of the specified channel.
9104  Description:
9105  This function sets the source address mode of the specified channel.
9106  Precondition:
9107  None.
9108  Parameters:
9109  channel - One of the possible DMA channels listed by DMA_CHANNEL
9110  sourceAddressMode - One of the possible source addressing modes listed by
9111  DMA_SOURCE_ADDRESSING_MODE
9112  Returns:
9113  None.
9114  Example:
9115  <code>
9116  PLIB_DMA_ChannelXSourceAddressModeSelect (
9117  DMA_ID_0,
9118  DMA_CHANNEL_4,
9119  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9120  </code>
9121  Remarks:
9122  This feature is not available on all devices. Please refer to the specific
9123  device data sheet to determine availability.
9124 */
9125 
9126 void
9128  DMA_MODULE_ID index ,
9129  DMA_CHANNEL channel ,
9130  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9131 //******************************************************************************
9132 /* Function:
9133  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9134  DMA_MODULE_ID index,
9135  DMA_CHANNEL channel )
9136  Summary:
9137  Gets the source address mode of the specified channel.
9138  Description:
9139  This function gets the source address mode of the specified channel.
9140  Precondition:
9141  None.
9142  Parameters:
9143  channel - One of the possible DMA channels listed by DMA_CHANNEL
9144  Returns:
9145  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9146  listed by DMA_SOURCE_ADDRESSING_MODE
9147  Example:
9148  <code>
9149  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9150  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9151  DMA_CHANNEL_4 );
9152  </code>
9153  Remarks:
9154  This feature is not available on all devices. Please refer to the specific
9155  device data sheet to determine availability.
9156 */
9157 
9158 DMA_SOURCE_ADDRESSING_MODE
9160  DMA_MODULE_ID index ,
9161  DMA_CHANNEL channel ) ;
9162 //******************************************************************************
9163 /* Function:
9164  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9165  DMA_MODULE_ID index,
9166  DMA_CHANNEL channel,
9167  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9168  Summary:
9169  Sets the source address mode of the specified channel.
9170  Description:
9171  This function Sets the source address mode of the specified channel.
9172  Precondition:
9173  None.
9174  Parameters:
9175  channel - One of the possible DMA channels listed by DMA_CHANNEL
9176  destinationAddressMode - One of the possible source addressing modes listed by
9177  DMA_DESTINATION_ADDRESSING_MODE
9178  Returns:
9179  None.
9180  Example:
9181  <code>
9182  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9183  DMA_ID_0,
9184  DMA_CHANNEL_4,
9185  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9186  </code>
9187  Remarks:
9188  This feature is not available on all devices. Please refer to the specific
9189  device data sheet to determine availability.
9190 */
9191 
9192 void
9194  DMA_MODULE_ID index ,
9195  DMA_CHANNEL channel ,
9196  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9197 //******************************************************************************
9198 /* Function:
9199  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9200  DMA_MODULE_ID index,
9201  DMA_CHANNEL channel )
9202  Summary:
9203  Gets the source address mode of the specified channel.
9204  Description:
9205  This function gets the source address mode of the specified channel.
9206  Precondition:
9207  None.
9208  Parameters:
9209  channel - One of the possible DMA channels listed by DMA_CHANNEL
9210  Returns:
9211  - destinationAddressMode - One of the possible source addressing modes listed by
9212  DMA_DESTINATION_ADDRESSING_MODE
9213  Example:
9214  <code>
9215  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9216  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9217  DMA_ID_0,
9218  DMA_CHANNEL_4 );
9219  </code>
9220  Remarks:
9221  This feature is not available on all devices. Please refer to the specific
9222  device data sheet to determine availability.
9223 */
9224 
9225 DMA_DESTINATION_ADDRESSING_MODE
9227  DMA_MODULE_ID index ,
9228  DMA_CHANNEL channel ) ;
9229 //******************************************************************************
9230 /* Function:
9231  void PLIB_DMA_ChannelXAddressModeSelect (
9232  DMA_MODULE_ID index,
9233  DMA_CHANNEL channel,
9234  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9235  Summary:
9236  Sets the channel address mode.
9237  Description:
9238  This function sets the channel address mode.
9239  Precondition:
9240  None.
9241  Parameters:
9242  channel - One of the possible DMA channels listed by DMA_CHANNEL
9243  channelAddressMode - One of the possible channel addressing modes listed by
9244  DMA_CHANNEL_ADDRESSING_MODE
9245  Returns:
9246  None.
9247  Example:
9248  <code>
9249  PLIB_DMA_ChannelXAddressModeSelect (
9250  DMA_ID_0,
9251  DMA_CHANNEL_4,
9252  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9253  </code>
9254  Remarks:
9255  This feature is not available on all devices. Please refer to the specific
9256  device data sheet to determine availability.
9257 */
9258 
9259 void
9261  DMA_MODULE_ID index ,
9262  DMA_CHANNEL channel ,
9263  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9264 //******************************************************************************
9265 /* Function:
9266  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9267  DMA_MODULE_ID index,
9268  DMA_CHANNEL channel )
9269  Summary:
9270  Gets the channel address mode.
9271  Description:
9272  This function gets the channel address mode.
9273  Precondition:
9274  None.
9275  Parameters:
9276  channel - One of the possible DMA channels listed by DMA_CHANNEL
9277  Returns:
9278  - channelAddressMode - One of the possible source addressing modes listed by
9279  DMA_CHANNEL_ADDRESSING_MODE
9280  Example:
9281  <code>
9282  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9283  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9284  DMA_CHANNEL_4 );
9285  </code>
9286  Remarks:
9287  This feature is not available on all devices. Please refer to the specific
9288  device data sheet to determine availability.
9289 */
9290 
9291 DMA_CHANNEL_ADDRESSING_MODE
9293  DMA_MODULE_ID index ,
9294  DMA_CHANNEL channel ) ;
9295 // *****************************************************************************
9296 // *****************************************************************************
9297 // Section: DMA Channel Event Configuration functions
9298 // *****************************************************************************
9299 // *****************************************************************************
9300 //******************************************************************************
9301 /* Function:
9302  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9303  DMA_CHANNEL channel,
9304  DMA_CHANNEL_TRIGGER_TYPE trigger )
9305  Summary:
9306  Enables the specified DMA channel trigger.
9307  Description:
9308  This function enables the specified DMA channel trigger.
9309  Precondition:
9310  None.
9311  Parameters:
9312  channel - One of the possible DMA channels listed by DMA_CHANNEL
9313  trigger - Type of trigger (transfer start/abort/pattern match abort)
9314  Returns:
9315  None.
9316  Example:
9317  <code>
9318  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9319  DMA_CHANNEL_4,
9320  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9321  </code>
9322  Remarks:
9323  This function implements an operation of the ChannelXTrigger feature.
9324  This feature may not be available on all devices. Please refer to the
9325  specific device data sheet to determine availability or use the
9326  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9327  determine whether this feature is available.
9328 */
9329 
9330 void
9332  DMA_MODULE_ID index ,
9333  DMA_CHANNEL channel ,
9334  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9335 //******************************************************************************
9336 /* Function:
9337  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9338  DMA_CHANNEL channel,
9339  DMA_CHANNEL_TRIGGER_TYPE trigger )
9340  Summary:
9341  Returns the enable status of the specified DMA transfer/abort trigger.
9342  Description:
9343  This function returns the enable status of the specified DMA transfer/abort trigger.
9344  Precondition:
9345  None.
9346  Parameters:
9347  channel - One of the possible DMA channels listed by DMA_CHANNEL
9348  trigger - Type of trigger (transfer start/abort/pattern match abort)
9349  Returns:
9350  - true - The specified trigger is enabled
9351  - false - The specified trigger is disabled
9352  Example:
9353  <code>
9354  bool startTriggerstatus;
9355  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9356  DMA_ID_0,
9357  DMA_CHANNEL_4,
9358  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9359  </code>
9360  Remarks:
9361  This function implements an operation of the ChannelXTrigger feature.
9362  This feature may not be available on all devices. Please refer to the
9363  specific device data sheet to determine availability or use the
9364  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9365  determine whether this feature is available.
9366 */
9367 
9368 bool
9370  DMA_MODULE_ID index ,
9371  DMA_CHANNEL channel ,
9372  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9373 //******************************************************************************
9374 /* Function:
9375  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9376  DMA_CHANNEL channel,
9377  DMA_CHANNEL_TRIGGER_TYPE trigger )
9378  Summary:
9379  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9380  Description:
9381  This function disables the DMA transfer abort via a matching interrupt
9382  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9383  a transfer.
9384  Precondition:
9385  None.
9386  Parameters:
9387  channel - One of the possible DMA channels listed by DMA_CHANNEL
9388  trigger - Type of trigger (transfer start/abort/pattern match abort)
9389  Returns:
9390  None.
9391  Example:
9392  <code>
9393  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9394  DMA_CHANNEL_4,
9395  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9396  </code>
9397  Remarks:
9398  This function implements an operation of the ChannelXTrigger feature.
9399  This feature may not be available on all devices. Please refer to the
9400  specific device data sheet to determine availability or use the
9401  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9402  determine whether this feature is available.
9403 */
9404 
9405 void
9407  DMA_MODULE_ID index ,
9408  DMA_CHANNEL channel ,
9409  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9410 //******************************************************************************
9411 /* Function:
9412  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9413  DMA_CHANNEL channel)
9414  Summary:
9415  Gets the source number for the DMA channel interrupts.
9416  Description:
9417  This function returns the interrupt source number for the specified
9418  DMA channel.
9419  Precondition:
9420  None.
9421  Parameters:
9422  channel - One of the possible DMA channels listed by DMA_CHANNEL
9423  Returns:
9424  None.
9425  Example:
9426  <code>
9427  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9428  DMA_CHANNEL_4);
9429  </code>
9430  Remarks:
9431  This function implements an operation of the ChannelXTrigger feature.
9432  This feature may not be available on all devices. Please refer to the
9433  specific device data sheet to determine availability or use the
9434  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9435  determine whether this feature is available.
9436 */
9437 
9438 DMA_CHANNEL_INT_SOURCE
9440  DMA_MODULE_ID index ,
9441  DMA_CHANNEL channel ) ;
9442 //******************************************************************************
9443 /* Function:
9444  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9445  DMA_CHANNEL channel,
9446  DMA_TRIGGER_SOURCE IRQnum )
9447  Summary:
9448  Sets the IRQ to initiate the DMA transfer on the specified channel.
9449  Description:
9450  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9451  (IRQ to start the channel transfer.)
9452  Precondition:
9453  None.
9454  Parameters:
9455  channel - One of the possible DMA channels listed by DMA_CHANNEL
9456  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9457  Returns:
9458  None.
9459  Example:
9460  <code>
9461  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9462  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9463  DMA_CHANNEL_4,
9464  irq );
9465  </code>
9466  Remarks:
9467  This function implements an operation of the ChannelXStartIRQ feature.
9468  This feature may not be available on all devices. Please refer to the
9469  specific device data sheet to determine availability or use the
9470  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9471  determine whether this feature is available.
9472 */
9473 
9474 void
9476  DMA_MODULE_ID index ,
9477  DMA_CHANNEL channel ,
9478  DMA_TRIGGER_SOURCE IRQnum ) ;
9479 //******************************************************************************
9480 /* Function:
9481  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9482  DMA_CHANNEL channel,
9483  DMA_TRIGGER_SOURCE IRQ )
9484  Summary:
9485  Sets the IRQ to abort the DMA transfer on the specified channel.
9486  Description:
9487  This function sets the IRQ to abort the DMA transfer on the specified channel.
9488  (IRQ to start the channel transfer.)
9489  Precondition:
9490  None.
9491  Parameters:
9492  channel - One of the possible DMA channels listed by DMA_CHANNEL
9493  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9494  Returns:
9495  None.
9496  Example:
9497  <code>
9498  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9499  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9500  DMA_CHANNEL_4,
9501  irq );
9502  </code>
9503  Remarks:
9504  This function implements an operation of the ChannelXAbortIRQ feature.
9505  This feature may not be available on all devices. Please refer to the
9506  specific device data sheet to determine availability or use the
9507  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9508  determine whether this feature is available.
9509 */
9510 
9511 void
9513  DMA_MODULE_ID index ,
9514  DMA_CHANNEL channel ,
9515  DMA_TRIGGER_SOURCE IRQ ) ;
9516 //******************************************************************************
9517 /* Function:
9518  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9519  DMA_CHANNEL channel,
9520  DMA_CHANNEL_DATA_SIZE channelDataSize )
9521  Summary:
9522  Selects the data size for the specified channel.
9523  Description:
9524  This function selects the data size for the specified channel.
9525  Precondition:
9526  None.
9527  Parameters:
9528  channel - One of the possible DMA channels listed by DMA_CHANNEL
9529  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9530  Returns:
9531  None.
9532  Example:
9533  <code>
9534  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9535  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9536  DMA_CHANNEL_4,
9537  channelDataSize );
9538  </code>
9539  Remarks:
9540  This feature is not available on all devices. Please refer to the specific
9541  device data sheet to determine availability.
9542 */
9543 
9544 void
9546  DMA_MODULE_ID index ,
9547  DMA_CHANNEL channel ,
9548  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9549 //******************************************************************************
9550 /* Function:
9551  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9552  DMA_CHANNEL channel )
9553  Summary:
9554  Returns the current data size for the specified channel.
9555  Description:
9556  This function returns the current data size for the specified channel.
9557  Precondition:
9558  None.
9559  Parameters:
9560  channel - One of the possible DMA channels listed by DMA_CHANNEL
9561  Returns:
9562  - channelDataSize - One of the possible data sizes listed by
9563  DMA_CHANNEL_DATA_SIZE
9564  Example:
9565  <code>
9566  DMA_CHANNEL_DATA_SIZE channelDataSize;
9567  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9568  DMA_CHANNEL_4 );
9569  </code>
9570  Remarks:
9571  This feature is not available on all devices. Please refer to the specific
9572  device data sheet to determine availability.
9573 */
9574 
9575 DMA_CHANNEL_DATA_SIZE
9577  DMA_MODULE_ID index ,
9578  DMA_CHANNEL channel ) ;
9579 //******************************************************************************
9580 /* Function:
9581  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9582  DMA_MODULE_ID index,
9583  DMA_CHANNEL channel,
9584  DMA_TRANSFER_MODE channeltransferMode )
9585  Summary:
9586  Selects the transfer/operating mode for the specified channel.
9587  Description:
9588  This function selects the transfer/operating mode for the specified channel.
9589  (Transfer mode and operating mode are used interchangeably.)
9590  Precondition:
9591  None.
9592  Parameters:
9593  channel - One of the possible DMA channels listed by DMA_CHANNEL
9594  channeltransferMode - One of the possible operating/transfer modes listed by
9595  DMA_TRANSFER_MODE
9596  Returns:
9597  None.
9598  Example:
9599  <code>
9600  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9601  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9602  DMA_CHANNEL_4,
9603  channeltransferMode );
9604  </code>
9605  Remarks:
9606  This feature is not available on all devices. Please refer to the specific
9607  device data sheet to determine availability.
9608 */
9609 
9610 void
9612  DMA_MODULE_ID index ,
9613  DMA_CHANNEL channel ,
9614  DMA_TRANSFER_MODE channeltransferMode ) ;
9615 //******************************************************************************
9616 /* Function:
9617  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9618  DMA_MODULE_ID index,
9619  DMA_CHANNEL channel )
9620  Summary:
9621  Returns the current transfer/operating mode for the specified channel.
9622  Description:
9623  This function returns the current transfer/operating mode for the specified channel.
9624  (Transfer mode and operating mode are used interchangeably.)
9625  Precondition:
9626  None.
9627  Parameters:
9628  channel - One of the possible DMA channels listed by DMA_CHANNEL
9629  Returns:
9630  - channeltransferMode - One of the possible operating/transfer modes listed
9631  by DMA_TRANSFER_MODE
9632  Example:
9633  <code>
9634  DMA_TRANSFER_MODE channeltransferMode;
9635  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9636  DMA_ID_0,
9637  DMA_CHANNEL_4 );
9638  </code>
9639  Remarks:
9640  This feature is not available on all devices. Please refer to the specific
9641  device data sheet to determine availability.
9642 */
9643 
9644 DMA_TRANSFER_MODE
9646  DMA_MODULE_ID index ,
9647  DMA_CHANNEL channel ) ;
9648 //******************************************************************************
9649 /* Function:
9650  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9651  DMA_CHANNEL channel )
9652  Summary:
9653  Enables reloading of the address and count registers.
9654  Description:
9655  This function enables reloading of the address and count registers. The source,
9656  destination address, and the DMA count registers are reloaded to their previous
9657  values upon the start of the next operation.
9658  Precondition:
9659  None.
9660  Parameters:
9661  channel - One of the possible DMA channels listed by DMA_CHANNEL
9662  Returns:
9663  None.
9664  Example:
9665  <code>
9666  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9667  DMA_CHANNEL_4 );
9668  </code>
9669  Remarks:
9670  This feature is not available on all devices. Please refer to the specific
9671  device data sheet to determine availability.
9672 */
9673 
9674 void
9676  DMA_MODULE_ID index ,
9677  DMA_CHANNEL channel ) ;
9678 //******************************************************************************
9679 /* Function:
9680  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9681  DMA_CHANNEL channel )
9682  Summary:
9683  Returns the address and count registers reload enable status.
9684  Description:
9685  This function returns the address and count registers reload enable status.
9686  Precondition:
9687  None.
9688  Parameters:
9689  channel - One of the possible DMA channels listed by DMA_CHANNEL
9690  Returns:
9691  - true - The address and count registers reload is enabled
9692  - false - The address and count registers reload is disabled
9693  Example:
9694  <code>
9695  bool chAddressCountReloadStatus;
9696  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9697  DMA_ID_0,
9698  DMA_CHANNEL_4 );
9699  </code>
9700  Remarks:
9701  This feature is not available on all devices. Please refer to the specific
9702  device data sheet to determine availability.
9703 */
9704 
9705 bool
9707  DMA_MODULE_ID index ,
9708  DMA_CHANNEL channel ) ;
9709 //******************************************************************************
9710 /* Function:
9711  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9712  DMA_CHANNEL channel )
9713  Summary:
9714  Disables reloading of the address and count registers.
9715  Description:
9716  This function disables reloading of the address and count registers. The source, destination
9717  address, and the DMA count registers are not reloaded to their previous values upon
9718  the start of the next operation.
9719  Precondition:
9720  None.
9721  Parameters:
9722  channel - One of the possible DMA channels listed by DMA_CHANNEL
9723  Returns:
9724  None.
9725  Example:
9726  <code>
9727  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9728  DMA_CHANNEL_4 );
9729  </code>
9730  Remarks:
9731  This feature is not available on all devices. Please refer to the specific
9732  device data sheet to determine availability.
9733 */
9734 
9735 void
9737  DMA_MODULE_ID index ,
9738  DMA_CHANNEL channel ) ;
9739 //******************************************************************************
9740 /* Function:
9741  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9742  DMA_CHANNEL channel )
9743  Summary:
9744  Enables the Null Write mode.
9745  Description:
9746  This function enables the Null Write mode. A dummy write is initiated to the
9747  source address for every write to the destination address.
9748  Precondition:
9749  None.
9750  Parameters:
9751  channel - One of the possible DMA channels listed by DMA_CHANNEL
9752  Returns:
9753  None.
9754  Example:
9755  <code>
9756  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9757  DMA_CHANNEL_4 );
9758  </code>
9759  Remarks:
9760  This feature is not available on all devices. Please refer to the specific
9761  device data sheet to determine availability.
9762 */
9763 
9764 void
9766  DMA_MODULE_ID index ,
9767  DMA_CHANNEL channel ) ;
9768 //******************************************************************************
9769 /* Function:
9770  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9771  DMA_CHANNEL channel )
9772  Summary:
9773  Returns the enable status of the Null Write mode for the specified channel.
9774  Description:
9775  This function returns the enable status of the Null Write mode for the specified channel.
9776  Precondition:
9777  None.
9778  Parameters:
9779  channel - One of the possible DMA channels listed by DMA_CHANNEL
9780  Returns:
9781  - true - Null write mode is enabled for this channel
9782  - false - Null write mode is disabled for this channel
9783  Example:
9784  <code>
9785  bool chNullWriteStatus;
9786  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9787  DMA_ID_0,
9788  DMA_CHANNEL_4 );
9789  </code>
9790  Remarks:
9791  This feature is not available on all devices. Please refer to the specific
9792  device data sheet to determine availability.
9793 */
9794 
9795 bool
9797  DMA_MODULE_ID index ,
9798  DMA_CHANNEL channel ) ;
9799 //******************************************************************************
9800 /* Function:
9801  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9802  DMA_CHANNEL channel )
9803  Summary:
9804  Disables the Null Write mode.
9805  Description:
9806  This function disables the Null Write mode. No dummy write is initiated.
9807  Precondition:
9808  None.
9809  Parameters:
9810  channel - One of the possible DMA channels listed by DMA_CHANNEL
9811  Returns:
9812  None.
9813  Example:
9814  <code>
9815  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9816  DMA_CHANNEL_4 );
9817  </code>
9818  Remarks:
9819  This feature is not available on all devices. Please refer to the specific
9820  device data sheet to determine availability.
9821 */
9822 
9823 void
9825  DMA_MODULE_ID index ,
9826  DMA_CHANNEL channel ) ;
9827 // *****************************************************************************
9828 // *****************************************************************************
9829 // Section: DMA start/end functions
9830 // *****************************************************************************
9831 // *****************************************************************************
9832 //******************************************************************************
9833 /* Function:
9834  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9835  DMA_CHANNEL channel )
9836  Summary:
9837  Initiates transfer on the specified channel.
9838  Description:
9839  This function initiates transfer on the specified channel. This is a forced transfer
9840  controlled via software.
9841  Precondition:
9842  None.
9843  Parameters:
9844  channel - One of the possible DMA channels listed by DMA_CHANNEL
9845  Returns:
9846  None.
9847  Example:
9848  <code>
9849  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9850  DMA_CHANNEL_4 );
9851  </code>
9852  Remarks:
9853  This function implements an operation of the StartTransfer feature.
9854  This feature may not be available on all devices. Please refer to the
9855  specific device data sheet to determine availability or use the
9856  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9857  determine whether this feature is available.
9858 */
9859 
9860 void
9862  DMA_MODULE_ID index ,
9863  DMA_CHANNEL channel ) ;
9864 //******************************************************************************
9865 /* Function:
9866  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9867  DMA_CHANNEL channel )
9868  Summary:
9869  Aborts transfer on the specified channel.
9870  Description:
9871  This function aborts transfer on the specified channel. This is a forced abort
9872  controlled via software.
9873  Precondition:
9874  None.
9875  Parameters:
9876  channel - One of the possible DMA channels listed by DMA_CHANNEL
9877  Returns:
9878  None.
9879  Example:
9880  <code>
9881  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9882  DMA_CHANNEL_4 );
9883  </code>
9884  Remarks:
9885  This function implements an operation of the AbortTransfer feature.
9886  This feature may not be available on all devices. Please refer to the
9887  specific device data sheet to determine availability or use the
9888  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9889  determine whether this feature is available.
9890 */
9891 
9892 void
9894  DMA_MODULE_ID index ,
9895  DMA_CHANNEL channel ) ;
9896 // *****************************************************************************
9897 // *****************************************************************************
9898 // Section: DMA General Configuration functions
9899 // *****************************************************************************
9900 // *****************************************************************************
9901 //******************************************************************************
9902 /* Function:
9903  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9904  Summary:
9905  Sets the BUSY bit of the DMA controller.
9906  Description:
9907  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9908  Precondition:
9909  None.
9910  Parameters:
9911  None.
9912  Returns:
9913  None.
9914  Example:
9915  <code>
9916  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9917  </code>
9918  Remarks:
9919  This function implements an operation of the Busy feature.
9920  This feature may not be available on all devices. Please refer to the
9921  specific device data sheet to determine availability or use the
9922  PLIB_DMA_ExistsBusy function in your application to automatically
9923  determine whether this feature is available.
9924 */
9925 
9926 void
9928  DMA_MODULE_ID index ) ;
9929 //******************************************************************************
9930 /* Function:
9931  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9932  Summary:
9933  Resets the BUSY bit of the DMA controller.
9934  Description:
9935  This function resets the BUSY bit of the DMA controller. The DMA module is
9936  disabled and is not actively transferring data.
9937  Precondition:
9938  None.
9939  Parameters:
9940  None.
9941  Returns:
9942  None.
9943  Example:
9944  <code>
9945  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9946  </code>
9947  Remarks:
9948  This function implements an operation of the Busy feature.
9949  This feature may not be available on all devices. Please refer to the
9950  specific device data sheet to determine availability or use the
9951  PLIB_DMA_ExistsBusy function in your application to automatically
9952  determine whether this feature is available.
9953 */
9954 
9955 void
9957  DMA_MODULE_ID index ) ;
9958 //******************************************************************************
9959 /* Function:
9960  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9961  Summary:
9962  Gets the BUSY bit of the DMA controller.
9963  Description:
9964  This function gets the BUSY bit of the DMA controller.
9965  Precondition:
9966  None.
9967  Parameters:
9968  None.
9969  Returns:
9970  - true - DMA module is active
9971  - false - DMA module is disabled and is not actively transferring data
9972  Example:
9973  <code>
9974  bool dmaBusyStatus;
9975  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9976  </code>
9977  Remarks:
9978  This function implements an operation of the Busy feature.
9979  This feature may not be available on all devices. Please refer to the
9980  specific device data sheet to determine availability or use the
9981  PLIB_DMA_ExistsBusy function in your application to automatically
9982  determine whether this feature is available.
9983 */
9984 
9985 bool
9986  PLIB_DMA_IsBusy (
9987  DMA_MODULE_ID index ) ;
9988 //******************************************************************************
9989 /* Function:
9990  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9991  Summary:
9992  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
9993  Description:
9994  This function suspends the DMA transfers to allow uninterrupted access
9995  by the CPU to the data bus.
9996  Precondition:
9997  None.
9998  Parameters:
9999  None.
10000  Returns:
10001  None.
10002  Example:
10003  <code>
10004  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10005  </code>
10006  Remarks:
10007  This function implements an operation of the Suspend feature.
10008  This feature may not be available on all devices. Please refer to the
10009  specific device data sheet to determine availability or use the
10010  PLIB_DMA_ExistsSuspend function in your application to automatically
10011  determine whether this feature is available.
10012 */
10013 
10014 void
10016  DMA_MODULE_ID index ) ;
10017 //******************************************************************************
10018 /* Function:
10019  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10020  Summary:
10021  DMA suspend is disabled and the DMA module operates normally.
10022  Description:
10023  This function disables the DMA suspend. The DMA module continues to operate
10024  normally.
10025  Precondition:
10026  None.
10027  Parameters:
10028  None.
10029  Returns:
10030  None.
10031  Example:
10032  <code>
10033  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10034  </code>
10035  Remarks:
10036  This function implements an operation of the Suspend feature.
10037  This feature may not be available on all devices. Please refer to the
10038  specific device data sheet to determine availability or use the
10039  PLIB_DMA_ExistsSuspend function in your application to automatically
10040  determine whether this feature is available.
10041 */
10042 
10043 void
10045  DMA_MODULE_ID index ) ;
10046 //******************************************************************************
10047 /* Function:
10048  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10049  Summary:
10050  Returns the DMA suspend status.
10051  Description:
10052  This function returns the DMA suspend status.
10053  Precondition:
10054  None.
10055  Parameters:
10056  None.
10057  Returns:
10058  - true - The DMA transfers are suspended
10059  - false - The DMA operates normally
10060  Example:
10061  <code>
10062  bool dmaSuspendStatus;
10063  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10064  </code>
10065  Remarks:
10066  This function implements an operation of the Suspend feature.
10067  This feature may not be available on all devices. Please refer to the
10068  specific device data sheet to determine availability or use the
10069  PLIB_DMA_ExistsSuspend function in your application to automatically
10070  determine whether this feature is available.
10071 */
10072 
10073 bool
10075  DMA_MODULE_ID index ) ;
10076 //******************************************************************************
10077 /* Function:
10078  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10079  Summary:
10080  DMA transfers are halted during Idle mode.
10081  Description:
10082  This function halts DMA transfers during Idle mode.
10083  Precondition:
10084  None.
10085  Parameters:
10086  None.
10087  Returns:
10088  None.
10089  Example:
10090  <code>
10091  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10092  </code>
10093  Remarks:
10094  This function implements an operation of the StopInIdle feature.
10095  This feature may not be available on all devices. Please refer to the
10096  specific device data sheet to determine availability or use the
10097  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10098  determine whether this feature is available.
10099 */
10100 
10101 void
10103  DMA_MODULE_ID index ) ;
10104 //******************************************************************************
10105 /* Function:
10106  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10107  Summary:
10108  DMA transfers continue during Idle mode.
10109  Description:
10110  This function causes DMA transfers to continue during Idle mode.
10111  Precondition:
10112  None.
10113  Parameters:
10114  None.
10115  Returns:
10116  None.
10117  Example:
10118  <code>
10119  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10120  </code>
10121  Remarks:
10122  This function implements an operation of the StopInIdle feature.
10123  This feature may not be available on all devices. Please refer to the
10124  specific device data sheet to determine availability or use the
10125  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10126  determine whether this feature is available.
10127 */
10128 
10129 void
10131  DMA_MODULE_ID index ) ;
10132 //******************************************************************************
10133 /* Function:
10134  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10135  Summary:
10136  DMA module is enabled.
10137  Description:
10138  This function enables the DMA module.
10139  Precondition:
10140  None.
10141  Parameters:
10142  None.
10143  Returns:
10144  None.
10145  Example:
10146  <code>
10147  PLIB_DMA_Enable( DMA_ID_0 );
10148  </code>
10149  Remarks:
10150  This function implements an operation of the EnableControl feature.
10151  This feature may not be available on all devices. Please refer to the
10152  specific device data sheet to determine availability or use the
10153  PLIB_DMA_ExistsEnableControl function in your application to automatically
10154  determine whether this feature is available.
10155 */
10156 
10157 void
10158  PLIB_DMA_Enable (
10159  DMA_MODULE_ID index ) ;
10160 //******************************************************************************
10161 /* Function:
10162  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10163  Summary:
10164  Returns the DMA module enable status.
10165  Description:
10166  This function returns the DMA module enable status.
10167  Precondition:
10168  None.
10169  Parameters:
10170  None.
10171  Returns:
10172  - true - The DMA is enabled
10173  - false - The DMA is disabled
10174  Example:
10175  <code>
10176  PLIB_DMA_IsEnabled( DMA_ID_0 );
10177  </code>
10178  Remarks:
10179  This function implements an operation of the EnableControl feature.
10180  This feature may not be available on all devices. Please refer to the
10181  specific device data sheet to determine availability or use the
10182  PLIB_DMA_ExistsEnableControl function in your application to automatically
10183  determine whether this feature is available.
10184 */
10185 
10186 bool
10188  DMA_MODULE_ID index ) ;
10189 //******************************************************************************
10190 /* Function:
10191  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10192  Summary:
10193  DMA module is disabled.
10194  Description:
10195  This function disables the DMA module.
10196  Precondition:
10197  None.
10198  Parameters:
10199  None.
10200  Returns:
10201  None.
10202  Example:
10203  <code>
10204  PLIB_DMA_Disable( DMA_ID_0 );
10205  </code>
10206  Remarks:
10207  This function implements an operation of the EnableControl feature.
10208  This feature may not be available on all devices. Please refer to the
10209  specific device data sheet to determine availability or use the
10210  PLIB_DMA_ExistsEnableControl function in your application to automatically
10211  determine whether this feature is available.
10212 */
10213 
10214 void
10216  DMA_MODULE_ID index ) ;
10217 // *****************************************************************************
10218 // *****************************************************************************
10219 // Section: DMA status functions
10220 // *****************************************************************************
10221 // *****************************************************************************
10222 //******************************************************************************
10223 /* Function:
10224  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10225  Summary:
10226  Returns the DMA channel bits.
10227  Description:
10228  This function returns the channel bits.
10229  Precondition:
10230  None.
10231  Parameters:
10232  None.
10233  Returns:
10234  - uint8_t - DMA channel bits
10235  Example:
10236  <code>
10237  uint8_t dmaChBits;
10238  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10239  </code>
10240  Remarks:
10241  This function implements an operation of the ChannelBits feature.
10242  This feature may not be available on all devices. Please refer to the
10243  specific device data sheet to determine availability or use the
10244  PLIB_DMA_ExistsChannelBits function in your application to automatically
10245  determine whether this feature is available.
10246 */
10247 
10248 uint8_t
10250  DMA_MODULE_ID index ) ;
10251 //******************************************************************************
10252 /* Function:
10253  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10254  Summary:
10255  Returns true if the last DMA bus access was a read.
10256  Description:
10257  This function returns true if the last DMA bus access was a read.
10258  Precondition:
10259  None.
10260  Parameters:
10261  None.
10262  Returns:
10263  - true - The last bus access was a read
10264  - false - The last bus access was not a read
10265  Example:
10266  <code>
10267  bool dmaLastBusAccessType;
10268  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10269  </code>
10270  Remarks:
10271  This function implements an operation of the LastBusAccess feature.
10272  This feature may not be available on all devices. Please refer to the
10273  specific device data sheet to determine availability or use the
10274  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10275  determine whether this feature is available.
10276 */
10277 
10278 bool
10280  DMA_MODULE_ID index ) ;
10281 //******************************************************************************
10282 /* Function:
10283  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10284  Summary:
10285  Returns true if the last DMA bus access was a write.
10286  Description:
10287  This function returns true if the last DMA bus access was a write operation.
10288  Precondition:
10289  None.
10290  Parameters:
10291  None.
10292  Returns:
10293  - true - The last bus access was a write operation
10294  - false - The last bus access was not a write operation
10295  Example:
10296  <code>
10297  bool dmaLastBusAccessType;
10298  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10299  </code>
10300  Remarks:
10301  This function implements an operation of the LastBusAccess feature.
10302  This feature may not be available on all devices. Please refer to the
10303  specific device data sheet to determine availability or use the
10304  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10305  determine whether this feature is available.
10306 */
10307 
10308 bool
10310  DMA_MODULE_ID index ) ;
10311 //******************************************************************************
10312 /* Function:
10313  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10314  Summary:
10315  Returns the address of the most recent DMA access.
10316  Description:
10317  This function returns the address of the most recent DMA access.
10318  Precondition:
10319  None.
10320  Parameters:
10321  None.
10322  Returns:
10323  - uint32_t - The most recent address accessed by the DMA
10324  Example:
10325  <code>
10326  uint32_t dmaLastAddressAccessed;
10327  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10328  </code>
10329  Remarks:
10330  This function implements an operation of the RecentAddress feature.
10331  This feature may not be available on all devices. Please refer to the
10332  specific device data sheet to determine availability or use the
10333  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10334  determine whether this feature is available.
10335 */
10336 
10337 uint32_t
10339  DMA_MODULE_ID index ) ;
10340 // *****************************************************************************
10341 // *****************************************************************************
10342 // Section: DMA Module CRC Feature Interface Functions
10343 // *****************************************************************************
10344 // *****************************************************************************
10345 //******************************************************************************
10346 /* Function:
10347  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10348  DMA_CHANNEL channel )
10349  Summary:
10350  Assigns the CRC to the specified DMA channel.
10351  Description:
10352  This function assigns the CRC feature to the specified channel.
10353  Precondition:
10354  None.
10355  Parameters:
10356  channel - One of the possible DMA channels listed by DMA_CHANNEL
10357  Returns:
10358  None.
10359  Example:
10360  <code>
10361  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10362  DMA_CHANNEL_5 );
10363  </code>
10364  Remarks:
10365  This function implements an operation of the CRCChannel feature.
10366  This feature may not be available on all devices. Please refer to the
10367  specific device data sheet to determine availability or use the
10368  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10369  determine whether this feature is available.
10370 */
10371 
10372 void
10374  DMA_MODULE_ID index ,
10375  DMA_CHANNEL channel ) ;
10376 //******************************************************************************
10377 /* Function:
10378  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10379  Summary:
10380  Returns the current DMA channel to which the CRC is assigned.
10381  Description:
10382  This function returns the current DMA channel to which the CRC is assigned.
10383  Precondition:
10384  None.
10385  Parameters:
10386  None.
10387  Returns:
10388  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10389  Example:
10390  <code>
10391  DMA_CHANNEL crcChannel;
10392  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10393  </code>
10394  Remarks:
10395  This function implements an operation of the CRCChannel feature.
10396  This feature may not be available on all devices. Please refer to the
10397  specific device data sheet to determine availability or use the
10398  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10399  determine whether this feature is available.
10400 */
10401 
10402 DMA_CHANNEL
10404  DMA_MODULE_ID index ) ;
10405 //******************************************************************************
10406 /* Function:
10407  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10408  DMA_CRC_TYPE CRCType )
10409  Summary:
10410  Selects the DMA module CRC feature type.
10411  Description:
10412  This function selects the DMA module CRC feature type. The CRC feature will
10413  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10414  checksum.
10415  Precondition:
10416  None.
10417  Parameters:
10418  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10419  Returns:
10420  None.
10421  Example:
10422  <code>
10423  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10424  DMA_CRC_IP_HEADER );
10425  </code>
10426  Remarks:
10427  This function implements an operation of the CRCType feature.
10428  This feature may not be available on all devices. Please refer to the
10429  specific device data sheet to determine availability or use the
10430  PLIB_DMA_ExistsCRCType function in your application to automatically
10431  determine whether this feature is available.
10432 */
10433 
10434 void
10436  DMA_MODULE_ID index ,
10437  DMA_CRC_TYPE CRCType ) ;
10438 //******************************************************************************
10439 /* Function:
10440  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10441  Summary:
10442  Gets the current DMA module CRC feature type.
10443  Description:
10444  This function gets the DMA module CRC feature type. The CRC feature will
10445  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10446  checksum.
10447  Precondition:
10448  None.
10449  Parameters:
10450  None.
10451  Returns:
10452  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10453  Example:
10454  <code>
10455  DMA_CRC_TYPE CRCType;
10456  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10457  </code>
10458  Remarks:
10459  This function implements an operation of the CRCType feature.
10460  This feature may not be available on all devices. Please refer to the
10461  specific device data sheet to determine availability or use the
10462  PLIB_DMA_ExistsCRCType function in your application to automatically
10463  determine whether this feature is available.
10464 */
10465 
10466 DMA_CRC_TYPE
10468  DMA_MODULE_ID index ) ;
10469 //******************************************************************************
10470 /* Function:
10471  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10472  Summary:
10473  Enables the CRC append mode.
10474  Description:
10475  This function enables the CRC append mode. The DMA transfers data from the source
10476  into the CRC, but not to the destination. When a block transfer completes, the
10477  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10478  Precondition:
10479  None.
10480  Parameters:
10481  None.
10482  Returns:
10483  None.
10484  Example:
10485  <code>
10486  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10487  </code>
10488  Remarks:
10489  This function implements an operation of the CRCAppendMode feature.
10490  This feature may not be available on all devices. Please refer to the
10491  specific device data sheet to determine availability or use the
10492  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10493  determine whether this feature is available.
10494 */
10495 
10496 void
10498  DMA_MODULE_ID index ) ;
10499 //******************************************************************************
10500 /* Function:
10501  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10502  Summary:
10503  Gets the enable status of the CRC append mode.
10504  Description:
10505  This function gets the enable status of the CRC append mode.
10506  Precondition:
10507  None.
10508  Parameters:
10509  None.
10510  Returns:
10511  - true - CRC append mode is enabled
10512  - false - CRC append mode is disabled
10513  Example:
10514  <code>
10515  bool DMAcrcAppendMode;
10516  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10517  </code>
10518  Remarks:
10519  This function implements an operation of the CRCAppendMode feature.
10520  This feature may not be available on all devices. Please refer to the
10521  specific device data sheet to determine availability or use the
10522  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10523  determine whether this feature is available.
10524 */
10525 
10526 bool
10528  DMA_MODULE_ID index ) ;
10529 //******************************************************************************
10530 /* Function:
10531  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10532  Summary:
10533  Disables the CRC append mode.
10534  Description:
10535  This function disables the CRC append mode. The DMA transfers data from the
10536  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10537  as it writes the data to the destination.
10538  Precondition:
10539  None.
10540  Parameters:
10541  None.
10542  Returns:
10543  None.
10544  Example:
10545  <code>
10546  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10547  </code>
10548  Remarks:
10549  This function implements an operation of the CRCAppendMode feature.
10550  This feature may not be available on all devices. Please refer to the
10551  specific device data sheet to determine availability or use the
10552  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10553  determine whether this feature is available.
10554 */
10555 
10556 void
10558  DMA_MODULE_ID index ) ;
10559 //******************************************************************************
10560 /* Function:
10561  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10562  Summary:
10563  Enables the DMA module CRC feature.
10564  Description:
10565  This function enables the DMA module CRC feature. The channel transfers are
10566  routed through the CRC.
10567  Precondition:
10568  None.
10569  Parameters:
10570  None.
10571  Returns:
10572  None.
10573  Example:
10574  <code>
10575  PLIB_DMA_CRCEnable( DMA_ID_0 );
10576  </code>
10577  Remarks:
10578  This function implements an operation of the CRC feature.
10579  This feature may not be available on all devices. Please refer to the
10580  specific device data sheet to determine availability or use the
10581  PLIB_DMA_ExistsCRC function in your application to automatically
10582  determine whether this feature is available.
10583 */
10584 
10585 void
10587  DMA_MODULE_ID index ) ;
10588 //******************************************************************************
10589 /* Function:
10590  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10591  Summary:
10592  Gets the enable status of the CRC feature.
10593  Description:
10594  This function gets the enable status of the CRC feature.
10595  Precondition:
10596  None.
10597  Parameters:
10598  None.
10599  Returns:
10600  - true - The CRC feature is enabled
10601  - false - The CRC feature is disabled
10602  Example:
10603  <code>
10604  bool DMAcrcStatus;
10605  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10606  </code>
10607  Remarks:
10608  This function implements an operation of the CRC feature.
10609  This feature may not be available on all devices. Please refer to the
10610  specific device data sheet to determine availability or use the
10611  PLIB_DMA_ExistsCRC function in your application to automatically
10612  determine whether this feature is available.
10613 */
10614 
10615 bool
10617  DMA_MODULE_ID index ) ;
10618 //******************************************************************************
10619 /* Function:
10620  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10621  Summary:
10622  Disables the DMA module CRC feature.
10623  Description:
10624  This function disables the DMA module CRC feature. The channel transfers proceed
10625  normally.
10626  Precondition:
10627  None.
10628  Parameters:
10629  None.
10630  Returns:
10631  None.
10632  Example:
10633  <code>
10634  PLIB_DMA_CRCDisable( DMA_ID_0 );
10635  </code>
10636  Remarks:
10637  This function implements an operation of the CRC feature.
10638  This feature may not be available on all devices. Please refer to the
10639  specific device data sheet to determine availability or use the
10640  PLIB_DMA_ExistsCRC function in your application to automatically
10641  determine whether this feature is available.
10642 */
10643 
10644 void
10646  DMA_MODULE_ID index ) ;
10647 //******************************************************************************
10648 /* Function:
10649  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10650  uint8_t polyLength )
10651  Summary:
10652  Selects the polynomial length.
10653  Description:
10654  This function Selects the polynomial length.
10655  Precondition:
10656  None.
10657  Parameters:
10658  polyLength - Polynomial length
10659  Returns:
10660  None.
10661  Example:
10662  <code>
10663  uint8_t polyLength = 0x2;
10664  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10665  </code>
10666  Remarks:
10667  This function implements an operation of the CRCPolynomialLength feature.
10668  This feature may not be available on all devices. Please refer to the
10669  specific device data sheet to determine availability or use the
10670  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10671  determine whether this feature is available.
10672 */
10673 
10674 void
10676  DMA_MODULE_ID index ,
10677  uint8_t polyLength ) ;
10678 //******************************************************************************
10679 /* Function:
10680  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10681  Summary:
10682  Gets the current polynomial length.
10683  Description:
10684  This function gets the current polynomial length.
10685  Precondition:
10686  None.
10687  Parameters:
10688  None.
10689  Returns:
10690  - uint8_t - Polynomial length
10691  Example:
10692  <code>
10693  uint8_t polyLength;
10694  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10695  </code>
10696  Remarks:
10697  This function implements an operation of the CRCPolynomialLength feature.
10698  This feature may not be available on all devices. Please refer to the
10699  specific device data sheet to determine availability or use the
10700  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10701  determine whether this feature is available.
10702 */
10703 
10704 uint8_t
10706  DMA_MODULE_ID index ) ;
10707 //******************************************************************************
10708 /* Function:
10709  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10710  DMA_CRC_BIT_ORDER bitOrder )
10711  Summary:
10712  Selects the bit order for checksum calculation.
10713  Description:
10714  This function selects the bit order for checksum calculation.
10715  Precondition:
10716  None.
10717  Parameters:
10718  bitOrder - Specifies the bit order for CRC calculation
10719  Returns:
10720  None.
10721  Example:
10722  <code>
10723  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10724  </code>
10725  Remarks:
10726  This function implements an operation of the CRCBitOrder feature.
10727  This feature may not be available on all devices. Please refer to the
10728  specific device data sheet to determine availability or use the
10729  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10730  determine whether this feature is available.
10731 */
10732 
10733 void
10735  DMA_MODULE_ID index ,
10736  DMA_CRC_BIT_ORDER bitOrder ) ;
10737 //******************************************************************************
10738 /* Function:
10739  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10740  Summary:
10741  The source data is written to the destination reordered as defined by the
10742  BYTO<1:0> bits.
10743  Description:
10744  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10745  The source data is written to the destination reordered as defined by the
10746  BYTO<1:0> bits.
10747  Precondition:
10748  None.
10749  Parameters:
10750  None.
10751  Returns:
10752  None.
10753  Example:
10754  <code>
10755  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10756  </code>
10757  Remarks:
10758  This function implements an operation of the CRCWriteByteOrder feature.
10759  This feature may not be available on all devices. Please refer to the
10760  specific device data sheet to determine availability or use the
10761  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10762  determine whether this feature is available.
10763 */
10764 
10765 void
10767  DMA_MODULE_ID index ) ;
10768 //******************************************************************************
10769 /* Function:
10770  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10771  Summary:
10772  The source data is written to the destination unaltered.
10773  Description:
10774  This function disables byte order alteration. The source data is written
10775  to the destination unaltered.
10776  Precondition:
10777  None.
10778  Parameters:
10779  None.
10780  Returns:
10781  None.
10782  Example:
10783  <code>
10784  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10785  </code>
10786  Remarks:
10787  This function implements an operation of the CRCWriteByteOrder feature.
10788  This feature may not be available on all devices. Please refer to the
10789  specific device data sheet to determine availability or use the
10790  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10791  determine whether this feature is available.
10792 */
10793 
10794 void
10796  DMA_MODULE_ID index ) ;
10797 //******************************************************************************
10798 /* Function:
10799  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10800  DMA_CRC_BYTE_ORDER byteOrder )
10801  Summary:
10802  Selects the byte order.
10803  Description:
10804  This function selects the byte order.
10805  Precondition:
10806  The WBO bit must be set to use this function.
10807  Parameters:
10808  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10809  Returns:
10810  None.
10811  Example:
10812  <code>
10813  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10814  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10815  </code>
10816  Remarks:
10817  This function implements an operation of the CRCByteOrder feature.
10818  This feature may not be available on all devices. Please refer to the
10819  specific device data sheet to determine availability or use the
10820  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10821  determine whether this feature is available.
10822 */
10823 
10824 void
10826  DMA_MODULE_ID index ,
10827  DMA_CRC_BYTE_ORDER byteOrder ) ;
10828 //******************************************************************************
10829 /* Function:
10830  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10831  Summary:
10832  Gets the current byte order selected by the DMA module CRC feature.
10833  Description:
10834  This function gets the current byte order selected by the DMA module CRC feature.
10835  Precondition:
10836  The WBO bit must be set to use this function.
10837  Parameters:
10838  None.
10839  Returns:
10840  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10841  Example:
10842  <code>
10843  DMA_CRC_BYTE_ORDER byteOrder;
10844  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10845  </code>
10846  Remarks:
10847  This function implements an operation of the CRCByteOrder feature.
10848  This feature may not be available on all devices. Please refer to the
10849  specific device data sheet to determine availability or use the
10850  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10851  determine whether this feature is available.
10852 */
10853 
10854 DMA_CRC_BYTE_ORDER
10856  DMA_MODULE_ID index ) ;
10857 //******************************************************************************
10858 /* Function:
10859  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10860  Summary:
10861  Reads the contents of the DMA CRC data register.
10862  Description:
10863  This function reads the contents of the DMA CRC data register.
10864  Precondition:
10865  None.
10866  Parameters:
10867  None.
10868  Returns:
10869  - uint32_t - 32-bit CRC data
10870  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10871  device data sheet to determine availability.
10872  Example:
10873  <code>
10874  uint32_t DMACRCdata;
10875  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10876  </code>
10877  Remarks:
10878  This function implements an operation of the CRCData feature.
10879  This feature may not be available on all devices. Please refer to the
10880  specific device data sheet to determine availability or use the
10881  PLIB_DMA_ExistsCRCData function in your application to automatically
10882  determine whether this feature is available.
10883 */
10884 
10885 uint32_t
10887  DMA_MODULE_ID index ) ;
10888 //******************************************************************************
10889 /* Function:
10890  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10891  uint32_t DMACRCdata )
10892  Summary:
10893  Writes the contents of the DMA CRC data register with the specified data.
10894  Description:
10895  This function writes the contents of the DMA CRC data register.
10896  Precondition:
10897  None.
10898  Parameters:
10899  - DMACRCdata - 32-bit CRC data
10900  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10901  device data sheet to determine availability.
10902  Returns:
10903  None.
10904  Example:
10905  <code>
10906  uint32_t DMACRCdata = 0x0E0E0E;
10907  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10908  </code>
10909  Remarks:
10910  This function implements an operation of the CRCData feature.
10911  This feature may not be available on all devices. Please refer to the
10912  specific device data sheet to determine availability or use the
10913  PLIB_DMA_ExistsCRCData function in your application to automatically
10914  determine whether this feature is available.
10915 */
10916 
10917 void
10919  DMA_MODULE_ID index ,
10920  uint32_t DMACRCdata ) ;
10921 //******************************************************************************
10922 /* Function:
10923  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10924  Summary:
10925  Reads the CRC XOR register.
10926  Description:
10927  This function reads the CRC XOR register.
10928  Precondition:
10929  None.
10930  Parameters:
10931  None.
10932  Returns:
10933  - uint32_t - 32-bit CRC XOR enable mask data
10934  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10935  device data sheet to determine availability.
10936  Example:
10937  <code>
10938  uint32_t DMACRCXORdata;
10939  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10940  </code>
10941  Remarks:
10942  This function implements an operation of the CRCXOREnable feature.
10943  This feature may not be available on all devices. Please refer to the
10944  specific device data sheet to determine availability or use the
10945  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10946  determine whether this feature is available.
10947 */
10948 
10949 uint32_t
10951  DMA_MODULE_ID index ) ;
10952 //******************************************************************************
10953 /* Function:
10954  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10955  uint32_t DMACRCXOREnableMask )
10956  Summary:
10957  Writes to the CRC XOR enable register as per the specified enable mask.
10958  Description:
10959  This function writes to the CRC XOR enable register as per the specified
10960  enable mask. Each enabled bit will be taken as input to the shift register.
10961  Precondition:
10962  None.
10963  Parameters:
10964  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10965  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10966  device data sheet to determine availability.
10967  Returns:
10968  None.
10969  Example:
10970  <code>
10971  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10972  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10973  </code>
10974  Remarks:
10975  This function implements an operation of the CRCXOREnable feature.
10976  This feature may not be available on all devices. Please refer to the
10977  specific device data sheet to determine availability or use the
10978  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10979  determine whether this feature is available.
10980 */
10981 
10982 void
10984  DMA_MODULE_ID index ,
10985  uint32_t DMACRCXOREnableMask ) ;
10986 // *****************************************************************************
10987 // *****************************************************************************
10988 // Section: DMA Address control Interface functions
10989 // *****************************************************************************
10990 // *****************************************************************************
10991 //******************************************************************************
10992 /* Function:
10993  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
10994  DMA_CHANNEL dmaChannel )
10995  Summary:
10996  Reads the source start address configured for the specified channel.
10997  Description:
10998  This function reads the source start address configured for the specified
10999  channel.
11000  Precondition:
11001  None.
11002  Parameters:
11003  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11004  Returns:
11005  - uint32_t - The source start address configured for this channel
11006  Example:
11007  <code>
11008  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11009  uint32_t SourceStartAddress;
11010  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11011  spiDMAChannel );
11012  </code>
11013  Remarks:
11014  This function implements an operation of the ChannelXSourceStartAddress feature.
11015  This feature may not be available on all devices. Please refer to the
11016  specific device data sheet to determine availability or use the
11017  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11018  determine whether this feature is available.
11019 */
11020 
11021 uint32_t
11023  DMA_MODULE_ID index ,
11024  DMA_CHANNEL dmaChannel ) ;
11025 //******************************************************************************
11026 /* Function:
11027  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11028  DMA_CHANNEL dmaChannel,
11029  uint32_t sourceStartAddress)
11030  Summary:
11031  Writes the specified source start address into the register
11032  corresponding to the specified channel.
11033  Description:
11034  This function writes the specified Source start address into the register
11035  corresponding to the specified channel.
11036  Precondition:
11037  None.
11038  Parameters:
11039  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11040  sourceStartAddress - The source start address
11041  Returns:
11042  None.
11043  Example:
11044  <code>
11045  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11046  uint32_t sourceStartAddress = 0x00FDEA00;
11047  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11048  spiDMAChannel,
11049  sourceStartAddress );
11050  </code>
11051  Remarks:
11052  This function implements an operation of the ChannelXSourceStartAddress feature.
11053  This feature may not be available on all devices. Please refer to the
11054  specific device data sheet to determine availability or use the
11055  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11056  determine whether this feature is available.
11057 */
11058 
11059 void
11061  DMA_MODULE_ID index ,
11062  DMA_CHANNEL dmaChannel ,
11063  uint32_t sourceStartAddress ) ;
11064 //******************************************************************************
11065 /* Function:
11066  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11067  DMA_CHANNEL dmaChannel )
11068  Summary:
11069  Reads the destination start address configured for the specified channel.
11070  Description:
11071  This function reads the destination start address configured for the specified
11072  channel.
11073  Precondition:
11074  None.
11075  Parameters:
11076  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11077  Returns:
11078  - uint32_t - The destination start address configured for this channel
11079  Example:
11080  <code>
11081  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11082  uint32_t DestinationStartAddress;
11083  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11084  DMA_ID_0,
11085  spiDMAChannel );
11086  </code>
11087  Remarks:
11088  This function implements an operation of the ChannelXDestinationStartAddress feature.
11089  This feature may not be available on all devices. Please refer to the
11090  specific device data sheet to determine availability or use the
11091  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11092  determine whether this feature is available.
11093 */
11094 
11095 uint32_t
11097  DMA_MODULE_ID index ,
11098  DMA_CHANNEL dmaChannel ) ;
11099 //******************************************************************************
11100 /* Function:
11101  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11102  DMA_MODULE_ID index,
11103  DMA_CHANNEL dmaChannel,
11104  uint32_t destinationStartAddress)
11105  Summary:
11106  Writes the specified destination start address into the register corresponding to
11107  the specified channel.
11108  Description:
11109  This function writes the specified destination start address into the register
11110  corresponding to the specified channel.
11111  Precondition:
11112  None.
11113  Parameters:
11114  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11115  destinationStartAddress - The destination start address
11116  Returns:
11117  None.
11118  Example:
11119  <code>
11120  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11121  uint32_t destinationStartAddress = 0x00FDEA00;
11122  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11123  spiDMAChannel,
11124  destinationStartAddress );
11125  </code>
11126  Remarks:
11127  This function implements an operation of the ChannelXDestinationStartAddress feature.
11128  This feature may not be available on all devices. Please refer to the
11129  specific device data sheet to determine availability or use the
11130  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11131  determine whether this feature is available.
11132 */
11133 
11134 void
11136  DMA_MODULE_ID index ,
11137  DMA_CHANNEL dmaChannel ,
11138  uint32_t destinationStartAddress ) ;
11139 // *****************************************************************************
11140 // *****************************************************************************
11141 // Section: DMA Data control Interface functions
11142 // *****************************************************************************
11143 // *****************************************************************************
11144 //******************************************************************************
11145 /* Function:
11146  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11147  DMA_CHANNEL dmaChannel )
11148  Summary:
11149  Reads the source size configured for the specified channel.
11150  Description:
11151  This function reads the source size configured for the specified
11152  channel.
11153  Precondition:
11154  None.
11155  Parameters:
11156  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11157  Returns:
11158  - uint16_t - The Source size configured (in bytes) for this channel.
11159  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11160  device data sheet to determine availability.
11161  Example:
11162  <code>
11163  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11164  uint16_t sourceSize;
11165  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11166  spiDMAChannel );
11167  </code>
11168  Remarks:
11169  This function implements an operation of the ChannelXSourceSize feature.
11170  This feature may not be available on all devices. Please refer to the
11171  specific device data sheet to determine availability or use the
11172  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11173  determine whether this feature is available.
11174 */
11175 
11176 uint16_t
11178  DMA_MODULE_ID index ,
11179  DMA_CHANNEL dmaChannel ) ;
11180 //******************************************************************************
11181 /* Function:
11182  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11183  DMA_CHANNEL dmaChannel,
11184  uint16_t sourceSize)
11185  Summary:
11186  Writes the specified source size into the register corresponding
11187  to the specified channel.
11188  Description:
11189  This function writes the specified source size into the register
11190  corresponding to the specified channel.
11191  Precondition:
11192  None.
11193  Parameters:
11194  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11195  sourceSize - The source size. The source size (8-bit, 16-bit) is
11196  device-specific. Please refer to the specific device data
11197  sheet to determine availability.
11198  Returns:
11199  None.
11200  Example:
11201  <code>
11202  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11203  uint16_t sourceSize = 0xA00;
11204  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11205  spiDMAChannel,
11206  sourceSize );
11207  </code>
11208  Remarks:
11209  This function implements an operation of the ChannelXSourceSize feature.
11210  This feature may not be available on all devices. Please refer to the
11211  specific device data sheet to determine availability or use the
11212  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11213  determine whether this feature is available.
11214 */
11215 
11216 void
11218  DMA_MODULE_ID index ,
11219  DMA_CHANNEL dmaChannel ,
11220  uint16_t sourceSize ) ;
11221 //******************************************************************************
11222 /* Function:
11223  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11224  DMA_CHANNEL dmaChannel )
11225  Summary:
11226  Reads the destination size configured for the specified channel.
11227  Description:
11228  This function reads the destination size configured for the specified
11229  channel.
11230  Precondition:
11231  None.
11232  Parameters:
11233  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11234  Returns:
11235  - uint16_t - The destination size configured (in bytes) for this channel.
11236  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11237  device data sheet to determine availability.
11238  Example:
11239  <code>
11240  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11241  uint16_t DestinationSize;
11242  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11243  spiDMAChannel );
11244  </code>
11245  Remarks:
11246  This function implements an operation of the ChannelXDestinationSize feature.
11247  This feature may not be available on all devices. Please refer to the
11248  specific device data sheet to determine availability or use the
11249  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11250  determine whether this feature is available.
11251 */
11252 
11253 uint16_t
11255  DMA_MODULE_ID index ,
11256  DMA_CHANNEL dmaChannel ) ;
11257 //******************************************************************************
11258 /* Function:
11259  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11260  DMA_CHANNEL dmaChannel,
11261  uint16_t destinationSize)
11262  Summary:
11263  Writes the specified destination size into the register corresponding
11264  to the specified channel.
11265  Description:
11266  This function writes the specified destination size into the register
11267  corresponding to the specified channel.
11268  Precondition:
11269  None.
11270  Parameters:
11271  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11272  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11273  is device-specific. Please refer to the specific device
11274  data sheet to determine availability.)
11275  Returns:
11276  None.
11277  Example:
11278  <code>
11279  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11280  uint16_t destinationSize = 0xA00;
11281  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11282  </code>
11283  Remarks:
11284  This function implements an operation of the ChannelXDestinationSize feature.
11285  This feature may not be available on all devices. Please refer to the
11286  specific device data sheet to determine availability or use the
11287  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11288  determine whether this feature is available.
11289 */
11290 
11291 void
11293  DMA_MODULE_ID index ,
11294  DMA_CHANNEL dmaChannel ,
11295  uint16_t destinationSize ) ;
11296 //******************************************************************************
11297 /* Function:
11298  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11299  DMA_CHANNEL dmaChannel )
11300  Summary:
11301  Reads the current byte of the source being pointed to for the specified channel.
11302  Description:
11303  This function reads the current byte of the source being pointed to for the
11304  specified channel.
11305  Precondition:
11306  None.
11307  Parameters:
11308  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11309  Returns:
11310  - uint16_t - The source byte being pointed to for this channel.
11311  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11312  device data sheet to determine availability.
11313  Example:
11314  <code>
11315  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11316  uint16_t sourcebyte;
11317  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11318  </code>
11319  Remarks:
11320  This function implements an operation of the ChannelXSourcePointer feature.
11321  This feature may not be available on all devices. Please refer to the
11322  specific device data sheet to determine availability or use the
11323  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11324  determine whether this feature is available.
11325 */
11326 
11327 uint16_t
11329  DMA_MODULE_ID index ,
11330  DMA_CHANNEL dmaChannel ) ;
11331 //******************************************************************************
11332 /* Function:
11333  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11334  DMA_CHANNEL dmaChannel )
11335  Summary:
11336  Reads the current byte of the destination being pointed to for the specified channel.
11337  Description:
11338  This function reads the current byte of the destination being pointed to for the
11339  specified channel.
11340  Precondition:
11341  None.
11342  Parameters:
11343  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11344  Returns:
11345  - uint16_t - The destination byte being pointed to for this channel.
11346  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11347  device data sheet to determine availability.
11348  Example:
11349  <code>
11350  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11351  uint16_t destinationbyte;
11352  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11353  spiDMAChannel );
11354  </code>
11355  Remarks:
11356  This function implements an operation of the ChannelXDestinationPointer feature.
11357  This feature may not be available on all devices. Please refer to the
11358  specific device data sheet to determine availability or use the
11359  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11360  determine whether this feature is available.
11361 */
11362 
11363 uint16_t
11365  DMA_MODULE_ID index ,
11366  DMA_CHANNEL dmaChannel ) ;
11367 //******************************************************************************
11368 /* Function:
11369  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11370  DMA_CHANNEL dmaChannel )
11371  Summary:
11372  Reads the cell size (in bytes) configured for the specified channel.
11373  Description:
11374  This function reads the cell size (in bytes) configured for the specified
11375  channel.
11376  Precondition:
11377  None.
11378  Parameters:
11379  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11380  Returns:
11381  - uint16_t - The cell size configured (in bytes) for this channel
11382  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11383  device data sheet to determine availability.
11384  Example:
11385  <code>
11386  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11387  uint16_t cellSize;
11388  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11389  spiDMAChannel );
11390  </code>
11391  Remarks:
11392  This function implements an operation of the ChannelXCellSize feature.
11393  This feature may not be available on all devices. Please refer to the
11394  specific device data sheet to determine availability or use the
11395  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11396  determine whether this feature is available.
11397 */
11398 
11399 uint16_t
11401  DMA_MODULE_ID index ,
11402  DMA_CHANNEL dmaChannel ) ;
11403 //******************************************************************************
11404 /* Function:
11405  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11406  DMA_CHANNEL dmaChannel,
11407  uint16_t cellSize)
11408  Summary:
11409  Writes the specified cell size into the register corresponding
11410  to the specified channel.
11411  Description:
11412  This function writes the specified cell size into the register
11413  corresponding to the specified channel.
11414  Precondition:
11415  None.
11416  Parameters:
11417  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11418  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11419  device-specific. Please refer to the specific device data
11420  sheet to determine availability.)
11421  Returns:
11422  None.
11423  Example:
11424  <code>
11425  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11426  uint16_t cellSize = 0x10;
11427  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11428  </code>
11429  Remarks:
11430  This function implements an operation of the ChannelXCellSize feature.
11431  This feature may not be available on all devices. Please refer to the
11432  specific device data sheet to determine availability or use the
11433  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11434  determine whether this feature is available.
11435 */
11436 
11437 void
11439  DMA_MODULE_ID index ,
11440  DMA_CHANNEL dmaChannel ,
11441  uint16_t CellSize ) ;
11442 //******************************************************************************
11443 /* Function:
11444  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11445  DMA_CHANNEL dmaChannel )
11446  Summary:
11447  Returns the number of bytes transferred since the last event.
11448  Description:
11449  This function returns the number of bytes transferred since the last event.
11450  Precondition:
11451  None.
11452  Parameters:
11453  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11454  Returns:
11455  - uint16_t - The number of bytes transferred since the last event.
11456  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11457  the specific device data sheet to determine availability.
11458  Example:
11459  <code>
11460  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11461  uint16_t CellProgress;
11462  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11463  spiDMAChannel );
11464  </code>
11465  Remarks:
11466  This function implements an operation of the ChannelXCellProgressPointer feature.
11467  This feature may not be available on all devices. Please refer to the
11468  specific device data sheet to determine availability or use the
11469  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11470  determine whether this feature is available.
11471 */
11472 
11473 uint16_t
11475  DMA_MODULE_ID index ,
11476  DMA_CHANNEL dmaChannel ) ;
11477 //******************************************************************************
11478 /* Function:
11479  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11480  DMA_CHANNEL dmaChannel )
11481  Summary:
11482  Returns the pattern matching (for DMA abort) data programmed for the specified
11483  channel.
11484  Description:
11485  This function returns pattern matching (for DMA abort) data programmed for
11486  the specified channel.
11487  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11488  the specific device data sheet to determine availability.)
11489  Precondition:
11490  None.
11491  Parameters:
11492  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11493  Returns:
11494  - uint16_t - The pattern matching data programmed for the current channel.
11495  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11496  the specific device data sheet to determine availability.
11497  Example:
11498  <code>
11499  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11500  uint16_t patternData;
11501  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11502  </code>
11503  Remarks:
11504  This function implements an operation of the ChannelXPatternData feature.
11505  This feature may not be available on all devices. Please refer to the
11506  specific device data sheet to determine availability or use the
11507  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11508  determine whether this feature is available.
11509 */
11510 
11511 uint16_t
11513  DMA_MODULE_ID index ,
11514  DMA_CHANNEL dmaChannel ) ;
11515 //******************************************************************************
11516 /* Function:
11517  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11518  DMA_CHANNEL dmaChannel,
11519  uint16_t patternData)
11520  Summary:
11521  Writes the specified pattern matching data (for DMA abort) into the register
11522  corresponding to the specified channel.
11523  Description:
11524  This function writes the specified pattern matching data (for DMA abort) into the
11525  register corresponding to the specified channel.
11526  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11527  the specific device data sheet to determine availability.)
11528  Precondition:
11529  None.
11530  Parameters:
11531  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11532  patternData - The pattern matching DATA programmed for the current channel
11533  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11534  the specific device data sheet to determine availability.)
11535  Returns:
11536  None.
11537  Example:
11538  <code>
11539  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11540  uint16_t patternData = '\0';
11541  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11542  </code>
11543  Remarks:
11544  This function implements an operation of the ChannelXPatternData feature.
11545  This feature may not be available on all devices. Please refer to the
11546  specific device data sheet to determine availability or use the
11547  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11548  determine whether this feature is available.
11549 */
11550 
11551 void
11553  DMA_MODULE_ID index ,
11554  DMA_CHANNEL dmaChannel ,
11555  uint16_t patternData ) ;
11556 // *****************************************************************************
11557 // *****************************************************************************
11558 // Section: DMA Interrupt Control Interface functions
11559 // *****************************************************************************
11560 // *****************************************************************************
11561 //******************************************************************************
11562 /* Function:
11563  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11564  DMA_CHANNEL dmaChannel,
11565  DMA_INT_TYPE dmaINTSource )
11566  Summary:
11567  Returns the status of the interrupt flag of the specified DMA interrupt source
11568  for the specified channel.
11569  Description:
11570  This function returns the status of the interrupt flag of the specified DMA interrupt
11571  source for the specified channel.
11572  Precondition:
11573  None.
11574  Parameters:
11575  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11576  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11577  Returns:
11578  - true - The interrupt flag is set
11579  - false - The interrupt flag is not set
11580  Example:
11581  <code>
11582  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11583  bool AddressErrorINTStatus;
11584  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11585  DMA_ID_0,
11586  spiDMAChannel,
11587  DMA_INT_ADDRESS_ERROR );
11588  </code>
11589  Remarks:
11590  This function implements an operation of the ChannelXINTSourceFlag feature.
11591  This feature may not be available on all devices. Please refer to the
11592  specific device data sheet to determine availability or use the
11593  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11594  determine whether this feature is available.
11595 */
11596 
11597 bool
11599  DMA_MODULE_ID index ,
11600  DMA_CHANNEL dmaChannel ,
11601  DMA_INT_TYPE dmaINTSource ) ;
11602 //******************************************************************************
11603 /* Function:
11604  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11605  DMA_CHANNEL dmaChannel,
11606  DMA_INT_TYPE dmaINTSource )
11607  Summary:
11608  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11609  Description:
11610  This function sets the interrupt flag of the specified DMA interrupt source for
11611  the specified channel.
11612  Precondition:
11613  None.
11614  Parameters:
11615  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11616  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11617  Returns:
11618  None.
11619  Example:
11620  <code>
11621  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11622  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11623  spiDMAChannel,
11624  DMA_INT_ADDRESS_ERROR );
11625  </code>
11626  Remarks:
11627  This function implements an operation of the ChannelXINTSourceFlag feature.
11628  This feature may not be available on all devices. Please refer to the
11629  specific device data sheet to determine availability or use the
11630  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11631  determine whether this feature is available.
11632 */
11633 
11634 void
11636  DMA_MODULE_ID index ,
11637  DMA_CHANNEL dmaChannel ,
11638  DMA_INT_TYPE dmaINTSource ) ;
11639 //******************************************************************************
11640 /* Function:
11641  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11642  DMA_CHANNEL dmaChannel,
11643  DMA_INT_TYPE dmaINTSource )
11644  Summary:
11645  Clears the interrupt flag of the specified DMA interrupt source
11646  for the specified channel.
11647  Description:
11648  This function clears the interrupt flag of the specified DMA interrupt source
11649  for the specified channel.
11650  Precondition:
11651  None.
11652  Parameters:
11653  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11654  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11655  Returns:
11656  None.
11657  Example:
11658  <code>
11659  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11660  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11661  spiDMAChannel,
11662  DMA_INT_ADDRESS_ERROR );
11663  </code>
11664  Remarks:
11665  This function implements an operation of the ChannelXINTSourceFlag feature.
11666  This feature may not be available on all devices. Please refer to the
11667  specific device data sheet to determine availability or use the
11668  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11669  determine whether this feature is available.
11670 */
11671 
11672 void
11674  DMA_MODULE_ID index ,
11675  DMA_CHANNEL dmaChannel ,
11676  DMA_INT_TYPE dmaINTSource ) ;
11677 //******************************************************************************
11678 /* Function:
11679  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11680  DMA_CHANNEL dmaChannel,
11681  DMA_INT_TYPE dmaINTSource )
11682  Summary:
11683  Enables the specified interrupt source for the specified channel.
11684  Description:
11685  This function enables the specified interrupt source for the specified channel.
11686  Precondition:
11687  None.
11688  Parameters:
11689  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11690  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11691  Returns:
11692  None.
11693  Example:
11694  <code>
11695  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11696  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11697  spiDMAChannel,
11698  DMA_INT_ADDRESS_ERROR );
11699  </code>
11700  Remarks:
11701  This function implements an operation of the ChannelXINTSource feature.
11702  This feature may not be available on all devices. Please refer to the
11703  specific device data sheet to determine availability or use the
11704  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11705  determine whether this feature is available.
11706 */
11707 
11708 void
11710  DMA_MODULE_ID index ,
11711  DMA_CHANNEL dmaChannel ,
11712  DMA_INT_TYPE dmaINTSource ) ;
11713 //******************************************************************************
11714 /* Function:
11715  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11716  DMA_CHANNEL dmaChannel,
11717  DMA_INT_TYPE dmaINTSource )
11718  Summary:
11719  Disables the specified interrupt source for the specified channel.
11720  Description:
11721  This function disables the specified interrupt source for the specified channel.
11722  Precondition:
11723  None.
11724  Parameters:
11725  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11726  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11727  Returns:
11728  None.
11729  Example:
11730  <code>
11731  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11732  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11733  spiDMAChannel,
11734  DMA_INT_ADDRESS_ERROR );
11735  </code>
11736  Remarks:
11737  This function implements an operation of the ChannelXINTSource feature.
11738  This feature may not be available on all devices. Please refer to the
11739  specific device data sheet to determine availability or use the
11740  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11741  determine whether this feature is available.
11742 */
11743 
11744 void
11746  DMA_MODULE_ID index ,
11747  DMA_CHANNEL dmaChannel ,
11748  DMA_INT_TYPE dmaINTSource ) ;
11749 //******************************************************************************
11750 /* Function:
11751  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11752  DMA_CHANNEL dmaChannel,
11753  DMA_INT_TYPE dmaINTSource )
11754  Summary:
11755  Returns the enable status of the specified interrupt source for the specified channel.
11756  Description:
11757  This function returns the enable status of the specified interrupt source for the
11758  specified channel.
11759  Precondition:
11760  None.
11761  Parameters:
11762  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11763  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11764  Returns:
11765  - true - The interrupt is enabled
11766  - false - The interrupt is not enabled
11767  Example:
11768  <code>
11769  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11770  bool dmaINTSourceEnableStatus;
11771  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11772  DMA_ID_0,
11773  spiDMAChannel,
11774  DMA_INT_ADDRESS_ERROR );
11775  </code>
11776  Remarks:
11777  This function implements an operation of the ChannelXINTSource feature.
11778  This feature may not be available on all devices. Please refer to the
11779  specific device data sheet to determine availability or use the
11780  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11781  determine whether this feature is available.
11782 */
11783 
11784 bool
11786  DMA_MODULE_ID index ,
11787  DMA_CHANNEL dmaChannel ,
11788  DMA_INT_TYPE dmaINTSource ) ;
11789 //******************************************************************************
11790 /* Function:
11791  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11792  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11793  Summary:
11794  Sets the pattern match length.
11795  Description:
11796  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11797  Precondition:
11798  None.
11799  Parameters:
11800  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11801  patternLen - Length of pattern match (either 1 or 2)
11802  Returns:
11803  None.
11804  Example:
11805  <code>
11806  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11807  DMA_PATTERN_LENGTH patternLen;
11808  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11809  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11810  </code>
11811  Remarks:
11812  This function implements an operation of the ChannelXPatternLength feature.
11813  This feature may not be available on all devices. Please refer to the
11814  specific device data sheet to determine availability or use the
11815  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11816  determine whether this feature is available.
11817 */
11818 
11819 void
11821  DMA_MODULE_ID index ,
11822  DMA_CHANNEL dmaChannel ,
11823  DMA_PATTERN_LENGTH patternLen ) ;
11824 //******************************************************************************
11825 /* Function:
11826  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11827  DMA_CHANNEL dmaChannel);
11828  Summary:
11829  Returns the pattern match length.
11830  Description:
11831  This function returns the length of the byte matching the CHPIGN bits during a
11832  pattern match that may be ignored during the pattern match determination when
11833  the CHPIGNEN bit is set.
11834  Precondition:
11835  None.
11836  Parameters:
11837  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11838  Returns:
11839  - patternLen - Length of pattern match (either 1 or 2)
11840  Example:
11841  <code>
11842  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11843  DMA_PATTERN_LENGTH patternLen;
11844  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11845  </code>
11846  Remarks:
11847  This function implements an operation of the ChannelXPatternLength feature.
11848  This feature may not be available on all devices. Please refer to the
11849  specific device data sheet to determine availability or use the
11850  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11851  determine whether this feature is available.
11852 */
11853 
11854 DMA_PATTERN_LENGTH
11856  DMA_MODULE_ID index ,
11857  DMA_CHANNEL dmaChannel ) ;
11858 //******************************************************************************
11859 /* Function:
11860  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11861  DMA_CHANNEL channel );
11862  Summary:
11863  Enables the pattern match ignore byte.
11864  Description:
11865  This function enables the pattern match ignore byte.
11866  Precondition:
11867  None.
11868  Parameters:
11869  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11870  Returns:
11871  None.
11872  Example:
11873  <code>
11874  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11875  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11876  </code>
11877  Remarks:
11878  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11879  This feature may not be available on all devices. Please refer to the
11880  specific device data sheet to determine availability or use the
11881  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11882  determine whether this feature is available.
11883 */
11884 
11885 void
11887  DMA_MODULE_ID index ,
11888  DMA_CHANNEL channel ) ;
11889 //******************************************************************************
11890 /* Function:
11891  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11892  DMA_CHANNEL channel );
11893  Summary:
11894  Returns the state of the pattern match ignore byte.
11895  Description:
11896  This function returns the state (enabled or disabled) of the pattern match
11897  ignore byte.
11898  Precondition:
11899  None.
11900  Parameters:
11901  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11902  Returns:
11903  - true - The pattern match ignore byte is enabled
11904  - false - The pattern match ignore byte is disabled
11905  Example:
11906  <code>
11907  bool patternIsEnabled;
11908  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11909  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11910  </code>
11911  Remarks:
11912  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11913  This feature may not be available on all devices. Please refer to the
11914  specific device data sheet to determine availability or use the
11915  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11916  determine whether this feature is available.
11917 */
11918 
11919 bool
11921  DMA_MODULE_ID index ,
11922  DMA_CHANNEL channel ) ;
11923 //******************************************************************************
11924 /* Function:
11925  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11926  DMA_CHANNEL channel );
11927  Summary:
11928  Disables the pattern match ignore byte.
11929  Description:
11930  This function disables the pattern match ignore byte.
11931  Precondition:
11932  None.
11933  Parameters:
11934  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11935  Returns:
11936  None.
11937  Example:
11938  <code>
11939  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11940  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11941  </code>
11942  Remarks:
11943  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11944  This feature may not be available on all devices. Please refer to the
11945  specific device data sheet to determine availability or use the
11946  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11947  determine whether this feature is available.
11948 */
11949 
11950 void
11952  DMA_MODULE_ID index ,
11953  DMA_CHANNEL channel ) ;
11954 //******************************************************************************
11955 /* Function:
11956  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11957  DMA_CHANNEL channel, uint8_t pattern );
11958  Summary:
11959  Sets the pattern match ignore value.
11960  Description:
11961  This function sets the value of the pattern match ignore.
11962  Precondition:
11963  None.
11964  Parameters:
11965  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11966  pattern - Pattern match ignore value
11967  Returns:
11968  None.
11969  Example:
11970  <code>
11971  uint8_t patternMatch = 0x8;
11972  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11973  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11974  </code>
11975  Remarks:
11976  This function implements an operation of the ChannelXPatternIgnore feature.
11977  This feature may not be available on all devices. Please refer to the
11978  specific device data sheet to determine availability or use the
11979  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11980  determine whether this feature is available.
11981 */
11982 
11983 void
11985  DMA_MODULE_ID index ,
11986  DMA_CHANNEL channel ,
11987  uint8_t pattern ) ;
11988 //******************************************************************************
11989 /* Function:
11990  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11991  DMA_CHANNEL channel );
11992  Summary:
11993  Returns the pattern match ignore value.
11994  Description:
11995  This function returns the value of the pattern match ignore.
11996  Precondition:
11997  None.
11998  Parameters:
11999  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12000  Returns:
12001  - uint8_t - Pattern match ignore value
12002  Example:
12003  <code>
12004  uint8_t patternMatch;
12005  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12006  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12007  </code>
12008  Remarks:
12009  This function implements an operation of the ChannelXPatternIgnore feature.
12010  This feature may not be available on all devices. Please refer to the
12011  specific device data sheet to determine availability or use the
12012  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12013  determine whether this feature is available.
12014 */
12015 
12016 uint8_t
12018  DMA_MODULE_ID index ,
12019  DMA_CHANNEL channel ) ;
12020 // *****************************************************************************
12021 // *****************************************************************************
12022 // Section: DMA Peripheral Library Exists API Routines
12023 // *****************************************************************************
12024 // *****************************************************************************
12025 /* The following functions indicate the existence of the features on the device.
12026 */
12027 //******************************************************************************
12028 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12029  Summary:
12030  Identifies whether the Busy feature exists on the DMA module.
12031  Description:
12032  This function identifies whether the Busy feature is available on the
12033  DMA module.
12034  When this function returns true, these functions are supported on the device:
12035  - PLIB_DMA_BusyActiveSet
12036  - PLIB_DMA_BusyActiveReset
12037  - PLIB_DMA_IsBusy
12038  Preconditions:
12039  None.
12040  Parameters:
12041  index - Identifier for the device instance
12042  Returns:
12043  - true - The Busy feature is supported on the device
12044  - false - The Busy feature is not supported on the device
12045  Remarks:
12046  None.
12047 */
12048 
12049 bool
12051  DMA_MODULE_ID index ) ;
12052 //******************************************************************************
12053 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12054  Summary:
12055  Identifies whether the Suspend feature exists on the DMA module.
12056  Description:
12057  This function identifies whether the Suspend feature is available on the
12058  DMA module.
12059  When this function returns true, these functions are supported on the device:
12060  - PLIB_DMA_SuspendEnable
12061  - PLIB_DMA_SuspendDisable
12062  - PLIB_DMA_SuspendIsEnabled
12063  Preconditions:
12064  None.
12065  Parameters:
12066  index - Identifier for the device instance
12067  Returns:
12068  - true - The Suspend feature is supported on the device
12069  - false - The Suspend feature is not supported on the device
12070  Remarks:
12071  None.
12072 */
12073 
12074 bool
12076  DMA_MODULE_ID index ) ;
12077 //******************************************************************************
12078 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12079  Summary:
12080  Identifies whether the StopInIdle feature exists on the DMA module.
12081  Description:
12082  This function identifies whether the StopInIdle feature is available on the
12083  DMA module.
12084  When this function returns true, these functions are supported on the device:
12085  - PLIB_DMA_StopInIdleEnable
12086  - PLIB_DMA_StopInIdleDisable
12087  Preconditions:
12088  None.
12089  Parameters:
12090  index - Identifier for the device instance
12091  Returns:
12092  - true - The StopInIdle feature is supported on the device
12093  - false - The StopInIdle feature is not supported on the device
12094  Remarks:
12095  None.
12096 */
12097 
12098 bool
12100  DMA_MODULE_ID index ) ;
12101 //******************************************************************************
12102 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12103  Summary:
12104  Identifies whether the EnableControl feature exists on the DMA module.
12105  Description:
12106  This function identifies whether the EnableControl feature is available on
12107  the DMA module.
12108  When this function returns true, these functions are supported on the device:
12109  - PLIB_DMA_Enable
12110  - PLIB_DMA_Disable
12111  - PLIB_DMA_IsEnabled
12112  Preconditions:
12113  None.
12114  Parameters:
12115  index - Identifier for the device instance
12116  Returns:
12117  - true - The EnableControl feature is supported on the device
12118  - false - The EnableControl feature is not supported on the device
12119  Remarks:
12120  None.
12121 */
12122 
12123 bool
12125  DMA_MODULE_ID index ) ;
12126 //******************************************************************************
12127 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12128  Summary:
12129  Identifies whether the ChannelBits feature exists on the DMA module.
12130  Description:
12131  This function identifies whether the ChannelBits feature is available on the
12132  DMA module.
12133  When this function returns true, this function is supported on the device:
12134  - PLIB_DMA_ChannelBitsGet
12135  Preconditions:
12136  None.
12137  Parameters:
12138  index - Identifier for the device instance
12139  Returns:
12140  - true - The ChannelBits feature is supported on the device
12141  - false - The ChannelBits feature is not supported on the device
12142  Remarks:
12143  None.
12144 */
12145 
12146 bool
12148  DMA_MODULE_ID index ) ;
12149 //******************************************************************************
12150 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12151  Summary:
12152  Identifies whether the LastBusAccess feature exists on the DMA module.
12153  Description:
12154  This function identifies whether the LastBusAccess feature is available on the
12155  DMA module.
12156  When this function returns true, these functions are supported on the device:
12157  - PLIB_DMA_LastBusAccessIsRead
12158  - PLIB_DMA_LastBusAccessIsWrite
12159  Preconditions:
12160  None.
12161  Parameters:
12162  index - Identifier for the device instance
12163  Returns:
12164  - true - The LastBusAccess feature is supported on the device
12165  - false - The LastBusAccess feature is not supported on the device
12166  Remarks:
12167  None.
12168 */
12169 
12170 bool
12172  DMA_MODULE_ID index ) ;
12173 //******************************************************************************
12174 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12175  Summary:
12176  Identifies whether the RecentAddress feature exists on the DMA module.
12177  Description:
12178  This function identifies whether the RecentAddress feature is available on
12179  the DMA module.
12180  When this function returns true, this function is supported on the device:
12181  - PLIB_DMA_RecentAddressAccessed
12182  Preconditions:
12183  None.
12184  Parameters:
12185  index - Identifier for the device instance
12186  Returns:
12187  - true - The RecentAddress feature is supported on the device
12188  - false - The RecentAddress feature is not supported on the device
12189  Remarks:
12190  None.
12191 */
12192 
12193 bool
12195  DMA_MODULE_ID index ) ;
12196 //******************************************************************************
12197 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12198  Summary:
12199  Identifies whether the CRCChannel feature exists on the DMA module.
12200  Description:
12201  This function identifies whether the CRCChannel feature is available on the
12202  DMA module.
12203  When this function returns true, these functions are supported on the device:
12204  - PLIB_DMA_CRCChannelSelect
12205  - PLIB_DMA_CRCChannelGet
12206  Preconditions:
12207  None.
12208  Parameters:
12209  index - Identifier for the device instance
12210  Returns:
12211  - true - The CRCChannel feature is supported on the device
12212  - false - The CRCChannel feature is not supported on the device
12213  Remarks:
12214  None.
12215 */
12216 
12217 bool
12219  DMA_MODULE_ID index ) ;
12220 //******************************************************************************
12221 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12222  Summary:
12223  Identifies whether the CRCType feature exists on the DMA module.
12224  Description:
12225  This function identifies whether the CRCType feature is available on the
12226  DMA module.
12227  When this function returns true, these functions are supported on the device:
12228  - PLIB_DMA_CRCTypeGet
12229  - PLIB_DMA_CRCTypeSet
12230  Preconditions:
12231  None.
12232  Parameters:
12233  index - Identifier for the device instance
12234  Returns:
12235  - true - The CRCType feature is supported on the device
12236  - false - The CRCType feature is not supported on the device
12237  Remarks:
12238  None.
12239 */
12240 
12241 bool
12243  DMA_MODULE_ID index ) ;
12244 //******************************************************************************
12245 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12246  Summary:
12247  Identifies whether the CRCAppendMode feature exists on the DMA module.
12248  Description:
12249  This function identifies whether the CRCAppendMode feature is available on
12250  the DMA module.
12251  When this function returns true, these functions are supported on the device:
12252  - PLIB_DMA_CRCAppendModeEnable
12253  - PLIB_DMA_CRCAppendModeDisable
12254  - PLIB_DMA_CRCAppendModeIsEnabled
12255  Preconditions:
12256  None.
12257  Parameters:
12258  index - Identifier for the device instance
12259  Returns:
12260  - true - The CRCAppendMode feature is supported on the device
12261  - false - The CRCAppendMode feature is not supported on the device
12262  Remarks:
12263  None.
12264 */
12265 
12266 bool
12268  DMA_MODULE_ID index ) ;
12269 //******************************************************************************
12270 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12271  Summary:
12272  Identifies whether the CRC feature exists on the DMA module.
12273  Description:
12274  This function identifies whether the CRC feature is available on the DMA module.
12275  When this function returns true, these functions are supported on the device:
12276  - PLIB_DMA_CRCEnable
12277  - PLIB_DMA_CRCDisable
12278  - PLIB_DMA_CRCIsEnabled
12279  Preconditions:
12280  None.
12281  Parameters:
12282  index - Identifier for the device instance
12283  Returns:
12284  - true - The CRC feature is supported on the device
12285  - false - The CRC feature is not supported on the device
12286  Remarks:
12287  None.
12288 */
12289 
12290 bool
12292  DMA_MODULE_ID index ) ;
12293 //******************************************************************************
12294 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12295  Summary:
12296  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12297  Description:
12298  This function identifies whether the CRCPolynomialLength feature is available
12299  on the DMA module.
12300  When this function returns true, these functions are supported on the device:
12301  - PLIB_DMA_CRCPolynomialLengthSet
12302  - PLIB_DMA_CRCPolynomialLengthGet
12303  Preconditions:
12304  None.
12305  Parameters:
12306  index - Identifier for the device instance
12307  Returns:
12308  - true - The CRCPolynomialLength feature is supported on the device
12309  - false - The CRCPolynomialLength feature is not supported on the device
12310  Remarks:
12311  None.
12312 */
12313 
12314 bool
12316  DMA_MODULE_ID index ) ;
12317 //******************************************************************************
12318 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12319  Summary:
12320  Identifies whether the CRCBitOrder feature exists on the DMA module.
12321  Description:
12322  This function identifies whether the CRCBitOrder feature is available on the
12323  DMA module.
12324  When this function returns true, this function is supported on the device:
12325  - PLIB_DMA_CRCBitOrderSelect
12326  Preconditions:
12327  None.
12328  Parameters:
12329  index - Identifier for the device instance
12330  Returns:
12331  - true - The CRCBitOrder feature is supported on the device
12332  - false - The CRCBitOrder feature is not supported on the device
12333  Remarks:
12334  None.
12335 */
12336 
12337 bool
12339  DMA_MODULE_ID index ) ;
12340 //******************************************************************************
12341 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12342  Summary:
12343  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12344  Description:
12345  This function identifies whether the CRCWriteByteOrder feature is available
12346  on the DMA module.
12347  When this function returns true, these functions are supported on the device:
12348  - PLIB_DMA_CRCWriteByteOrderAlter
12349  - PLIB_DMA_CRCWriteByteOrderMaintain
12350  Preconditions:
12351  None.
12352  Parameters:
12353  index - Identifier for the device instance
12354  Returns:
12355  - true - The CRCWriteByteOrder feature is supported on the device
12356  - false - The CRCWriteByteOrder feature is not supported on the device
12357  Remarks:
12358  None.
12359 */
12360 
12361 bool
12363  DMA_MODULE_ID index ) ;
12364 //******************************************************************************
12365 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12366  Summary:
12367  Identifies whether the CRCByteOrder feature exists on the DMA module.
12368  Description:
12369  This function identifies whether the CRCByteOrder feature is available on
12370  the DMA module.
12371  When this function returns true, these functions are supported on the device:
12372  - PLIB_DMA_CRCByteOrderSelect
12373  - PLIB_DMA_CRCByteOrderGet
12374  Preconditions:
12375  None.
12376  Parameters:
12377  index - Identifier for the device instance
12378  Returns:
12379  - true - The CRCByteOrder feature is supported on the device
12380  - false - The CRCByteOrder feature is not supported on the device
12381  Remarks:
12382  None.
12383 */
12384 
12385 bool
12387  DMA_MODULE_ID index ) ;
12388 //******************************************************************************
12389 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12390  Summary:
12391  Identifies whether the CRCData feature exists on the DMA module.
12392  Description:
12393  This function identifies whether the CRCData feature is available on the
12394  DMA module.
12395  When this function returns true, these functions are supported on the device:
12396  - PLIB_DMA_CRCDataRead
12397  - PLIB_DMA_CRCDataWrite
12398  Preconditions:
12399  None.
12400  Parameters:
12401  index - Identifier for the device instance
12402  Returns:
12403  - true - The CRCData feature is supported on the device
12404  - false - The CRCData feature is not supported on the device
12405  Remarks:
12406  None.
12407 */
12408 
12409 bool
12411  DMA_MODULE_ID index ) ;
12412 //******************************************************************************
12413 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12414  Summary:
12415  Identifies whether the CRCXOREnable feature exists on the DMA module.
12416  Description:
12417  This function identifies whether the CRCXOREnable feature is available on the
12418  DMA module.
12419  When this function returns true, these functions are supported on the device:
12420  - PLIB_DMA_CRCXOREnableSet
12421  - PLIB_DMA_CRCXOREnableGet
12422  Preconditions:
12423  None.
12424  Parameters:
12425  index - Identifier for the device instance
12426  Returns:
12427  - true - The CRCXOREnable feature is supported on the device
12428  - false - The CRCXOREnable feature is not supported on the device
12429  Remarks:
12430  None.
12431 */
12432 
12433 bool
12435  DMA_MODULE_ID index ) ;
12436 //******************************************************************************
12437 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12438  Summary:
12439  Identifies whether the ChannelXPriority feature exists on the DMA module.
12440  Description:
12441  This function identifies whether the ChannelXPriority feature is available on
12442  the DMA module.
12443  When this function returns true, these functions are supported on the device:
12444  - PLIB_DMA_ChannelXPrioritySelect
12445  - PLIB_DMA_ChannelXPriorityGet
12446  Preconditions:
12447  None.
12448  Parameters:
12449  index - Identifier for the device instance
12450  Returns:
12451  - true - The ChannelXPriority feature is supported on the device
12452  - false - The ChannelXPriority feature is not supported on the device
12453  Remarks:
12454  None.
12455 */
12456 
12457 bool
12459  DMA_MODULE_ID index ) ;
12460 //******************************************************************************
12461 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12462  Summary:
12463  Identifies whether the ChannelXEvent feature exists on the DMA module.
12464  Description:
12465  This function identifies whether the ChannelXEvent feature is available on
12466  the DMA module.
12467  When this function returns true, this function is supported on the device:
12468  - PLIB_DMA_ChannelXEventIsDetected
12469  Preconditions:
12470  None.
12471  Parameters:
12472  index - Identifier for the device instance
12473  Returns:
12474  - true - The ChannelXEvent feature is supported on the device
12475  - false - The ChannelXEvent feature is not supported on the device
12476  Remarks:
12477  None.
12478 */
12479 
12480 bool
12482  DMA_MODULE_ID index ) ;
12483 //******************************************************************************
12484 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12485  Summary:
12486  Identifies whether the ChannelXAuto feature exists on the DMA module.
12487  Description:
12488  This function identifies whether the ChannelXAuto feature is available on
12489  the DMA module.
12490  When this function returns true, these functions are supported on the device:
12491  - PLIB_DMA_ChannelXAutoEnable
12492  - PLIB_DMA_ChannelXAutoDisable
12493  - PLIB_DMA_ChannelXAutoIsEnabled
12494  Preconditions:
12495  None.
12496  Parameters:
12497  index - Identifier for the device instance
12498  Returns:
12499  - true - The ChannelXAuto feature is supported on the device
12500  - false - The ChannelXAuto feature is not supported on the device
12501  Remarks:
12502  None.
12503 */
12504 
12505 bool
12507  DMA_MODULE_ID index ) ;
12508 //******************************************************************************
12509 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12510  Summary:
12511  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12512  Description:
12513  This function identifies whether the ChannelXChainEnbl feature is available
12514  on the DMA module.
12515  When this function returns true, these functions are supported on the device:
12516  - PLIB_DMA_ChannelXChainEnable
12517  - PLIB_DMA_ChannelXChainDisable
12518  - PLIB_DMA_ChannelXChainIsEnabled
12519  Preconditions:
12520  None.
12521  Parameters:
12522  index - Identifier for the device instance
12523  Returns:
12524  - true - The ChannelXChainEnbl feature is supported on the device
12525  - false - The ChannelXChainEnbl feature is not supported on the device
12526  Remarks:
12527  None.
12528 */
12529 
12530 bool
12532  DMA_MODULE_ID index ) ;
12533 //******************************************************************************
12534 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12535  Summary:
12536  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12537  Description:
12538  This function identifies whether the ChannelXDisabled feature is available
12539  on the DMA module.
12540  When this function returns true, these functions are supported on the device:
12541  - PLIB_DMA_ChannelXDisabledEnablesEvents
12542  - PLIB_DMA_ChannelXDisabledDisablesEvents
12543  Preconditions:
12544  None.
12545  Parameters:
12546  index - Identifier for the device instance
12547  Returns:
12548  - true - The ChannelXDisabled feature is supported on the device
12549  - false - The ChannelXDisabled feature is not supported on the device
12550  Remarks:
12551  None.
12552 */
12553 
12554 bool
12556  DMA_MODULE_ID index ) ;
12557 //******************************************************************************
12558 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12559  Summary:
12560  Identifies whether the ChannelX feature exists on the DMA module.
12561  Description:
12562  This function identifies whether the ChannelX feature is available on the
12563  DMA module.
12564  When this function returns true, these functions are supported on the device:
12565  - PLIB_DMA_ChannelXEnable
12566  - PLIB_DMA_ChannelXIsEnabled
12567  - PLIB_DMA_ChannelXDisable
12568  Preconditions:
12569  None.
12570  Parameters:
12571  index - Identifier for the device instance
12572  Returns:
12573  - true - The ChannelX feature is supported on the device
12574  - false - The ChannelX feature is not supported on the device
12575  Remarks:
12576  None.
12577 */
12578 
12579 bool
12581  DMA_MODULE_ID index ) ;
12582 //******************************************************************************
12583 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12584  Summary:
12585  Identifies whether the ChannelXChain feature exists on the DMA module.
12586  Description:
12587  This function identifies whether the ChannelXChain feature is available on the
12588  DMA module.
12589  When this function returns true, these functions are supported on the device:
12590  - PLIB_DMA_ChannelXChainToLower
12591  - PLIB_DMA_ChannelXChainToHigher
12592  Preconditions:
12593  None.
12594  Parameters:
12595  index - Identifier for the device instance
12596  Returns:
12597  - true - The ChannelXChain feature is supported on the device
12598  - false - The ChannelXChain feature is not supported on the device
12599  Remarks:
12600  None.
12601 */
12602 
12603 bool
12605  DMA_MODULE_ID index ) ;
12606 //******************************************************************************
12607 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12608  Summary:
12609  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12610  Description:
12611  This function identifies whether the ChannelXPatternLength feature is available
12612  on the DMA module.
12613  When this function returns true, these functions are supported on the device:
12614  - PLIB_DMA_ChannelXPatternLengthSet
12615  - PLIB_DMA_ChannelXPatternLengthGet
12616  Preconditions:
12617  None.
12618  Parameters:
12619  index - Identifier for the device instance
12620  Returns:
12621  - true - The ChannelXPatternLength feature is supported on the device
12622  - false - The ChannelXPatternLength feature is not supported on the device
12623  Remarks:
12624  None.
12625 */
12626 
12627 bool
12629  DMA_MODULE_ID index ) ;
12630 //******************************************************************************
12631 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12632  Summary:
12633  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12634  module.
12635  Description:
12636  This function identifies whether the ChannelXPatternIgnoreByte feature is
12637  available on the DMA module.
12638  When this function returns true, these functions are supported on the device:
12639  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12640  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12641  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12642  Preconditions:
12643  None.
12644  Parameters:
12645  index - Identifier for the device instance
12646  Returns:
12647  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12648  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12649  Remarks:
12650  None.
12651 */
12652 
12653 bool
12655  DMA_MODULE_ID index ) ;
12656 //******************************************************************************
12657 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12658  Summary:
12659  Identifies whether the ChannelXBusy feature exists on the DMA module.
12660  Description:
12661  This function identifies whether the ChannelXBusy feature is available on the
12662  DMA module.
12663  When this function returns true, these functions are supported on the device:
12664  - PLIB_DMA_ChannelXBusyActiveSet
12665  - PLIB_DMA_ChannelXBusyInActiveSet
12666  - PLIB_DMA_ChannelXBusyIsBusy
12667  Preconditions:
12668  None.
12669  Parameters:
12670  index - Identifier for the device instance
12671  Returns:
12672  - true - The ChannelXBusy feature is supported on the device
12673  - false - The ChannelXBusy feature is not supported on the device
12674  Remarks:
12675  None.
12676 */
12677 
12678 bool
12680  DMA_MODULE_ID index ) ;
12681 //******************************************************************************
12682 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12683  Summary:
12684  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12685  Description:
12686  This function identifies whether the ChannelXPatternIgnore feature is available
12687  on the DMA module.
12688  When this function returns true, these functions are supported on the device:
12689  - PLIB_DMA_ChannelXPatternIgnoreSet
12690  - PLIB_DMA_ChannelXPatternIgnoreGet
12691  Preconditions:
12692  None.
12693  Parameters:
12694  index - Identifier for the device instance
12695  Returns:
12696  - true - The ChannelXPatternIgnore feature is supported on the device
12697  - false - The ChannelXPatternIgnore feature is not supported on the device
12698  Remarks:
12699  None.
12700 */
12701 
12702 bool
12704  DMA_MODULE_ID index ) ;
12705 //******************************************************************************
12706 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12707  Summary:
12708  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12709  Description:
12710  This function identifies whether the ChannelXTrigger feature is available on
12711  the DMA module.
12712  When this function returns true, these functions are supported on the device:
12713  - PLIB_DMA_ChannelXTriggerEnable
12714  - PLIB_DMA_ChannelXTriggerIsEnabled
12715  - PLIB_DMA_ChannelXTriggerDisable
12716  Preconditions:
12717  None.
12718  Parameters:
12719  index - Identifier for the device instance
12720  Returns:
12721  - true - The ChannelXTrigger feature is supported on the device
12722  - false - The ChannelXTrigger feature is not supported on the device
12723  Remarks:
12724  None.
12725 */
12726 
12727 bool
12729  DMA_MODULE_ID index ) ;
12730 //******************************************************************************
12731 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12732  Summary:
12733  Identifies whether the AbortTransfer feature exists on the DMA module.
12734  Description:
12735  This function identifies whether the AbortTransfer feature is available on
12736  the DMA module.
12737  When this function returns true, this function is supported on the device:
12738  - PLIB_DMA_AbortTransferSet
12739  Preconditions:
12740  None.
12741  Parameters:
12742  index - Identifier for the device instance
12743  Returns:
12744  - true - The AbortTransfer feature is supported on the device
12745  - false - The AbortTransfer feature is not supported on the device
12746  Remarks:
12747  None.
12748 */
12749 
12750 bool
12752  DMA_MODULE_ID index ) ;
12753 //******************************************************************************
12754 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12755  Summary:
12756  Identifies whether the StartTransfer feature exists on the DMA module.
12757  Description:
12758  This function identifies whether the StartTransfer feature is available on
12759  the DMA module.
12760  When this function returns true, this function is supported on the device:
12761  - PLIB_DMA_StartTransferSet
12762  Preconditions:
12763  None.
12764  Parameters:
12765  index - Identifier for the device instance
12766  Returns:
12767  - true - The StartTransfer feature is supported on the device
12768  - false - The StartTransfer feature is not supported on the device
12769  Remarks:
12770  None.
12771 */
12772 
12773 bool
12775  DMA_MODULE_ID index ) ;
12776 //******************************************************************************
12777 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12778  Summary:
12779  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12780  Description:
12781  This function identifies whether the ChannelXStartIRQ feature is available
12782  on the DMA module.
12783  When this function returns true, this function is supported on the device:
12784  - PLIB_DMA_ChannelXStartIRQSet
12785  Preconditions:
12786  None.
12787  Parameters:
12788  index - Identifier for the device instance
12789  Returns:
12790  - true - The ChannelXStartIRQ feature is supported on the device
12791  - false - The ChannelXStartIRQ feature is not supported on the device
12792  Remarks:
12793  None.
12794 */
12795 
12796 bool
12798  DMA_MODULE_ID index ) ;
12799 //******************************************************************************
12800 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12801  Summary:
12802  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12803  Description:
12804  This function identifies whether the ChannelXAbortIRQ feature is available
12805  on the DMA module.
12806  When this function returns true, this function is supported on the device:
12807  - PLIB_DMA_ChannelXAbortIRQSet
12808  Preconditions:
12809  None.
12810  Parameters:
12811  index - Identifier for the device instance
12812  Returns:
12813  - true - The ChannelXAbortIRQ feature is supported on the device
12814  - false - The ChannelXAbortIRQ feature is not supported on the device
12815  Remarks:
12816  None.
12817 */
12818 
12819 bool
12821  DMA_MODULE_ID index ) ;
12822 //******************************************************************************
12823 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12824  Summary:
12825  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12826  Description:
12827  This function identifies whether the ChannelXINTSourceFlag feature is available
12828  on the DMA module.
12829  When this function returns true, these functions are supported on the device:
12830  - PLIB_DMA_ChannelXINTSourceFlagGet
12831  - PLIB_DMA_ChannelXINTSourceFlagSet
12832  - PLIB_DMA_ChannelXINTSourceFlagClear
12833  Preconditions:
12834  None.
12835  Parameters:
12836  index - Identifier for the device instance
12837  Returns:
12838  - true - The ChannelXINTSourceFlag feature is supported on the device
12839  - false - The ChannelXINTSourceFlag feature is not supported on the device
12840  Remarks:
12841  None.
12842 */
12843 
12844 bool
12846  DMA_MODULE_ID index ) ;
12847 //******************************************************************************
12848 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12849  Summary:
12850  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12851  Description:
12852  This function identifies whether the ChannelXINTSource feature is available
12853  on the DMA module.
12854  When this function returns true, these functions are supported on the device:
12855  - PLIB_DMA_ChannelXINTSourceEnable
12856  - PLIB_DMA_ChannelXINTSourceDisable
12857  - PLIB_DMA_ChannelXINTSourceIsEnabled
12858  Preconditions:
12859  None.
12860  Parameters:
12861  index - Identifier for the device instance
12862  Returns:
12863  - true - The ChannelXINTSource feature is supported on the device
12864  - false - The ChannelXINTSource feature is not supported on the device
12865  Remarks:
12866  None.
12867 */
12868 
12869 bool
12871  DMA_MODULE_ID index ) ;
12872 //******************************************************************************
12873 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12874  Summary:
12875  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12876  Description:
12877  This function identifies whether the ChannelXSourceStartAddress feature is available
12878  on the DMA module.
12879  When this function returns true, these functions are supported on the device:
12880  - PLIB_DMA_ChannelXSourceStartAddressGet
12881  - PLIB_DMA_ChannelXSourceStartAddressSet
12882  Preconditions:
12883  None.
12884  Parameters:
12885  index - Identifier for the device instance
12886  Returns:
12887  - true - The ChannelXSourceStartAddress feature is supported on the device
12888  - false - The ChannelXSourceStartAddress feature is not supported on the device
12889  Remarks:
12890  None.
12891 */
12892 
12893 bool
12895  DMA_MODULE_ID index ) ;
12896 //******************************************************************************
12897 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12898  Summary:
12899  Identifies whether the ChannelXDestinationStartAddress feature exists on
12900  the DMA module.
12901  Description:
12902  This function identifies whether the ChannelXDestinationStartAddress feature
12903  is available on the DMA module.
12904  When this function returns true, these functions are supported on the device:
12905  - PLIB_DMA_ChannelXDestinationStartAddressGet
12906  - PLIB_DMA_ChannelXDestinationStartAddressSet
12907  Preconditions:
12908  None.
12909  Parameters:
12910  index - Identifier for the device instance
12911  Returns:
12912  - true - The ChannelXDestinationStartAddress feature is supported on the device
12913  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12914  Remarks:
12915  None.
12916 */
12917 
12918 bool
12920  DMA_MODULE_ID index ) ;
12921 //******************************************************************************
12922 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12923  Summary:
12924  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12925  Description:
12926  This function identifies whether the ChannelXSourceSize feature is available
12927  on the DMA module.
12928  When this function returns true, these functions are supported on the device:
12929  - PLIB_DMA_ChannelXSourceSizeGet
12930  - PLIB_DMA_ChannelXSourceSizeSet
12931  Preconditions:
12932  None.
12933  Parameters:
12934  index - Identifier for the device instance
12935  Returns:
12936  - true - The ChannelXSourceSize feature is supported on the device
12937  - false - The ChannelXSourceSize feature is not supported on the device
12938  Remarks:
12939  None.
12940 */
12941 
12942 bool
12944  DMA_MODULE_ID index ) ;
12945 //******************************************************************************
12946 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12947  Summary:
12948  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12949  Description:
12950  This function identifies whether the ChannelXDestinationSize feature is available
12951  on the DMA module.
12952  When this function returns true, these functions are supported on the device:
12953  - PLIB_DMA_ChannelXDestinationSizeGet
12954  - PLIB_DMA_ChannelXDestinationSizeSet
12955  Preconditions:
12956  None.
12957  Parameters:
12958  index - Identifier for the device instance
12959  Returns:
12960  - true - The ChannelXDestinationSize feature is supported on the device
12961  - false - The ChannelXDestinationSize feature is not supported on the device
12962  Remarks:
12963  None.
12964 */
12965 
12966 bool
12968  DMA_MODULE_ID index ) ;
12969 //******************************************************************************
12970 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12971  Summary:
12972  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12973  Description:
12974  This function identifies whether the ChannelXSourcePointer feature is available
12975  on the DMA module.
12976  When this function returns true, this function is supported on the device:
12977  - PLIB_DMA_ChannelXSourcePointerGet
12978  Preconditions:
12979  None.
12980  Parameters:
12981  index - Identifier for the device instance
12982  Returns:
12983  - true - The ChannelXSourcePointer feature is supported on the device
12984  - false - The ChannelXSourcePointer feature is not supported on the device
12985  Remarks:
12986  None.
12987 */
12988 
12989 bool
12991  DMA_MODULE_ID index ) ;
12992 //******************************************************************************
12993 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
12994  Summary:
12995  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
12996  Description:
12997  This function identifies whether the ChannelXDestinationPointer feature is available
12998  on the DMA module.
12999  When this function returns true, this function is supported on the device:
13000  - PLIB_DMA_ChannelXDestinationPointerGet
13001  Preconditions:
13002  None.
13003  Parameters:
13004  index - Identifier for the device instance
13005  Returns:
13006  - true - The ChannelXDestinationPointer feature is supported on the device
13007  - false - The ChannelXDestinationPointer feature is not supported on the device
13008  Remarks:
13009  None.
13010 */
13011 
13012 bool
13014  DMA_MODULE_ID index ) ;
13015 //******************************************************************************
13016 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13017  Summary:
13018  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13019  Description:
13020  This function identifies whether the ChannelXCellSize feature is available on
13021  the DMA module.
13022  When this function returns true, these functions are supported on the device:
13023  - PLIB_DMA_ChannelXCellSizeGet
13024  - PLIB_DMA_ChannelXCellSizeSet
13025  Preconditions:
13026  None.
13027  Parameters:
13028  index - Identifier for the device instance
13029  Returns:
13030  - true - The ChannelXCellSize feature is supported on the device
13031  - false - The ChannelXCellSize feature is not supported on the device
13032  Remarks:
13033  None.
13034 */
13035 
13036 bool
13038  DMA_MODULE_ID index ) ;
13039 //******************************************************************************
13040 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13041  Summary:
13042  Identifies whether the ChannelXCellProgressPointer feature exists on the
13043  DMA module.
13044  Description:
13045  This function identifies whether the ChannelXCellProgressPointer feature is
13046  available on the DMA module.
13047  When this function returns true, this function is supported on the device:
13048  - PLIB_DMA_ChannelXCellProgressPointerGet
13049  Preconditions:
13050  None.
13051  Parameters:
13052  index - Identifier for the device instance
13053  Returns:
13054  - true - The ChannelXCellProgressPointer feature is supported on the device
13055  - false - The ChannelXCellProgressPointer feature is not supported on the device
13056  Remarks:
13057  None.
13058 */
13059 
13060 bool
13062  DMA_MODULE_ID index ) ;
13063 //******************************************************************************
13064 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13065  Summary:
13066  Identifies whether the ChannelXPatternData feature exists on the DMA module
13067  Description:
13068  This function identifies whether the ChannelXPatternData feature is available
13069  on the DMA module.
13070  When this function returns true, these functions are supported on the device:
13071  - PLIB_DMA_ChannelXPatternDataGet
13072  - PLIB_DMA_ChannelXPatternDataSet
13073  Preconditions:
13074  None.
13075  Parameters:
13076  index - Identifier for the device instance
13077  Returns:
13078  - true - The ChannelXPatternData feature is supported on the device
13079  - false - The ChannelXPatternData feature is not supported on the device
13080  Remarks:
13081  None.
13082 */
13083 
13084 bool
13086  DMA_MODULE_ID index ) ;
13087 //DOM-IGNORE-BEGIN
13088 //DOM-IGNORE-END
13089  // #ifndef _PLIB_DMA_H
13090 /*******************************************************************************
13091  End of File
13092 */
13093 
13094 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13095 /* CLOSE_FILE Include File */
13096 
13097 // *****************************************************************************
13098 // *****************************************************************************
13099 // Section: Data Types
13100 // *****************************************************************************
13101 // *****************************************************************************
13102 // *****************************************************************************
13103 /* DMA System Service Channel None
13104  Summary:
13105  DMA channel none
13106  Description:
13107  This constant identifies the specification of no choice from client
13108  for allocating a particular DMA channel.
13109  Remarks:
13110  This constant should be used in place of hard-coded numeric literals.
13111 */
13112 //DOM-IGNORE-BEGIN
13113 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13114 //DOM-IGNORE-END
13115 // *****************************************************************************
13116 /* DMA System Service Channel Any
13117  Summary:
13118  Identifies the client specification to allocate any available DMA channel.
13119  Description:
13120  This constant identifies the specification by the client
13121  to allocate any available DMA channel.
13122  Remarks:
13123  This constant should be used in place of hard-coded numeric literals.
13124 */
13125 //DOM-IGNORE-BEGIN
13126 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13127 //DOM-IGNORE-END
13128 // *****************************************************************************
13129 /* DMA System Service Channel Count
13130  Summary:
13131  Identifies the maximum number of DMA channel handles to be defined.
13132  Description:
13133  This constant identifies the maximum number of DMA channel handles
13134  that should be defined.
13135  Remarks:
13136  This value is derived from device-specific header files defined as
13137  part of the peripheral libraries.
13138 */
13139 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13140 // *****************************************************************************
13141 /* DMA System Service Channel Handle
13142  Summary:
13143  Assigns the handle for requested channel.
13144  Description:
13145  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13146  function. This handle is associated with the channel number that is used for
13147  data transfer and it allows the application to track the data transfer.
13148  The channel handle once assigned to a client expires when the
13149  client calls SYS_DMA_ChannelRelease.
13150  exits.
13151  Remarks:
13152  None.
13153 */
13154 
13155 typedef
13156 uintptr_t
13158 // *****************************************************************************
13159 /* DMA System Service Invalid Channel Handle
13160  Summary:
13161  Defines an invalid channel handle.
13162  Description:
13163  This is the definition of an invalid channel handle. An invalid buffer handle
13164  is returned by SYS_DMA_ChannelAllocate function if the channel number
13165  request was not successful.
13166  Remarks:
13167  None.
13168 */
13169 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13170 // *****************************************************************************
13171 /* DMA stop in idle mode
13172  Summary:
13173  Enable/Disable DMA operations in Idle mode.
13174  Description:
13175  This data type allows enabling/disabling of DMA operations in idle mode.
13176  Remarks:
13177  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13178  while initializing the DMA module by calling SYS_DMA_Initialize.
13179  This feature may not be available on all devices. Refer to the specific device
13180  data sheet to determine availability.
13181 */
13182 
13183 typedef
13184  enum
13185  {
13186  /* When the CPU enters idle mode, the DMA module continue operations */
13188  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13190  } SYS_DMA_SIDL ;
13191 // *****************************************************************************
13192 /* DMA Channel chaining priority
13193  Summary:
13194  Identifies the priority of chaining channel.
13195  Description:
13196  This data type identifies the priority of chaining channel.
13197  Channel chaining priority identifies the channel that will be enabled
13198  on completion of block data transfer on the master channel.
13199  Remarks:
13200  None.
13201 */
13202 
13203 typedef
13204  enum
13205  {
13206  /* Chain to channel higher in natural priority */
13208  /* Chain to channel lower in natural priority */
13211 // *****************************************************************************
13212 /* DMA Channel ignore pattern match
13213  Summary:
13214  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13215  pattern.
13216  Description:
13217  This data type allows enabling/disabling the feature to ignore a byte
13218  between a 2-byte match abort pattern.
13219  Remarks:
13220  This feature may not be available on all devices. Refer to the specific device
13221  data sheet to determine availability.
13222 */
13223 
13224 typedef
13225  enum
13226  {
13227  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13229  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13232 // *****************************************************************************
13233 /* DMA channel CRC mode
13234  Summary:
13235  Identifies the operation mode of the CRC module.
13236  Description:
13237  This data type identifies CRC operating mode. The CRC computation can be
13238  in background mode or append mode.
13239  Remarks:
13240  None.
13241 */
13242 
13243 typedef
13244  enum
13245  {
13246  /* DMA reads the data from the source, passes it through the CRC module and
13247  writes it to the destination. the calculated CRC is left in the DCRCDATA
13248  register at the end of the block transfer. */
13250  /* DMA only feeds source data to the CRC module. it does not write source data
13251  to the destination address. When a block transfer complete or pattern abort
13252  event occur, The DMA writes the CRC value to the destination address */
13255 // *****************************************************************************
13256 /* DMA channel CRC write order
13257  Summary:
13258  Identifies altering/maintaining write order post CRC computation.
13259  Description:
13260  This data type identifies write byte order selection post CRC
13261  computation.
13262  Remarks:
13263  None.
13264 */
13265 
13266 typedef
13267  enum
13268  {
13269  /* Source data is written to the destination unchanged regardless
13270  of the selected pre-CRC byte order. */
13272  /* Source data is written to the destination reordered according
13273  to the selected pre-CRC byte order. */
13276 // *****************************************************************************
13277 /* DMA channel operation modes
13278  Summary:
13279  Identifies the available DMA operating modes.
13280  Description:
13281  This data type Identifies the available DMA operating modes.
13282  The supported DMA modes are not mutually exclusive, but can be simultaneously
13283  operational.
13284  Remarks:
13285  These supported DMA modes can be logically OR'd together. They are passed
13286  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13287 */
13288 
13289 typedef
13290  enum
13291  {
13292  /* The normal DMA operation mode. The DMA channel will transfer data from
13293  a source to a destination without CPU intervention */
13294  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13295  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13296  ,
13297  /* Pattern Match abort mode allows the user to end a transfer if data
13298  written during a transaction matches a specific pattern, as defined by
13299  the DCHxDAT register */
13301  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13302  ,
13303  /* Channel chaining operating mode enhances the normal DMA channel
13304  operations. A channel(slave) can be chained to an adjacent channel(master).
13305  The slave channel will be enabled when a block transfer of the master
13306  channel completes. */
13307  /* only one of the below two chaining priorities must be provided.
13308  Chaining priority High. */
13310  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13311  ,
13312  /* Chaining priority Low */
13314  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13315  ,
13316  /* Auto enable operating mode allows a channel to be kept active, even if a
13317  block transfer completes or pattern match occurs. This prevents the user
13318  from having to re-enable the channel each time a block transfer completes. */
13319  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13320  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13321  ,
13322  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13323  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13324  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13326 // *****************************************************************************
13327 /* DMA channel CRC mode
13328  Summary:
13329  Defines the attributes for CRC operation mode.
13330  Description:
13331  This data type defines the attributes for CRC operation mode.
13332  Remarks:
13333  This feature may not be available on all devices. Refer to the specific device
13334  data sheet to determine availability.
13335 */
13336 
13337 typedef
13338  struct
13339  {
13340  /* CRC type (PLIB-level).
13341  Type Selection identifies whether the CRC module will calculate an IP
13342  header checksum or an LFSR CRC */
13343  DMA_CRC_TYPE type ;
13344  /* CRC mode, Background or Append */
13346  /* Polynomial length, This value is redundant when the selected CRC type is
13347  IP header checksum. When the CRC type is LFSR, Identifies the length of
13348  the polynomial. */
13349  uint8_t polyLength ;
13350  /* Bit order (PLIB-level).
13351  Identifies whether the CRC is computed LSb or MSb first */
13352  DMA_CRC_BIT_ORDER bitOrder ;
13353  /* Byte order (PLIB-level).
13354  Identifies the byte selection order input pre-CRC Generator. */
13355  DMA_CRC_BYTE_ORDER byteOrder ;
13356  /* Post CRC Write order */
13357  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13358  /* CRC data feed: While enabling the CRC mode, this field gives
13359  the seed for the CRC computation. On block transfer complete or
13360  pattern match abort the field have the computed CRC. */
13361  uint32_t data ;
13362  /* XOR bit mask, This value is redundant when the selected CRC type is
13363  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13364  bit mask input to the shift register during CRC computation. */
13365  uint32_t xorBitMask ;
13367 // *****************************************************************************
13368 /* DMA System service Events
13369  Summary:
13370  Enumeration of possible DMA System service events.
13371  Description:
13372  This data type provides an enumeration of all possible DMA System service events.
13373  Remarks:
13374  None.
13375 */
13376 
13377 typedef
13378  enum
13379  {
13380  /* Data was transferred successfully. */
13382  /* Error while processing the request */
13384  /* Data transfer was aborted. */
13386  /* No events yet. */
13389 // *****************************************************************************
13390 /* DMA System service Error
13391  Summary:
13392  Indicates the error information for the DMA System service.
13393  Description:
13394  This enumeration indicates the error information for the DMA System service.
13395  Remarks:
13396  None.
13397 */
13398 
13399 typedef
13400  enum
13401  {
13402  /* Data was transferred successfully. */
13403  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13404  = 1 << 0 ,
13405  /* DOM-IGNORE-END*/
13406  /* DMA address error. */
13407  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13408  = 1 << 1 /* DOM-IGNORE-END*/
13409  } SYS_DMA_ERROR ;
13410 // *****************************************************************************
13411 /* DMA Initialization data
13412  Summary:
13413  Defines the data required to initialize the DMA subsystem.
13414  Description:
13415  This data type defines the data required to initialize the DMA subsystem.
13416  Remarks:
13417  This feature may not be available on all devices. Refer to the specific device
13418  data sheet to determine availability.
13419 */
13420 
13421 typedef
13422  struct
13423  {
13424  /* Enable/Disable stop in idle mode feature */
13425  SYS_DMA_SIDL sidl ;
13426  } SYS_DMA_INIT ;
13427 // *****************************************************************************
13428 /* Data width options */
13429 
13430 typedef
13431  enum
13432  {
13433  /* Data width configuration feature is not available */
13435  } SYS_DMA_DATA_WIDTH ;
13436 // *****************************************************************************
13437 /* DMA descriptor control
13438  Summary:
13439  Defines the descriptor control for linked list operation.
13440  Description:
13441  This data type defines the descriptor control for linked list operation.
13442  Remarks:
13443  This feature may not be available on all devices. Refer to the specific device
13444  data sheet to determine availability.
13445 */
13446 
13447 typedef
13448  union
13449  {
13450  /* Feature is not supported */
13451  ;
13453 // *****************************************************************************
13454 // *****************************************************************************
13455 // Section: Initialization and Task Functions
13456 // *****************************************************************************
13457 // *****************************************************************************
13458 //******************************************************************************
13459 /* Function:
13460  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13461  Summary:
13462  Maintains the system service's state machine.
13463 
13464  Description:
13465  This function is used to maintain the DMA system service's internal state
13466  machine. This function services events on a specific DMA channel.
13467  Precondition:
13468  DMA should have been initialized by calling SYS_DMA_Initialize.
13469  Parameters:
13470  object - Object handle for the DMA module (returned from
13471  SYS_DMA_Initialize)
13472  activeChannel - DMA channel number to be serviced.
13473  Returns:
13474  None.
13475  Example:
13476  <code>
13477  // 'object' Returned from SYS_DMA_Initialize
13478  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13479  {
13480  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13481  }
13482  </code>
13483  Remarks:
13484  This function is normally not called directly by an application. It is
13485  called by the system's task/interrupt routines.
13486  */
13487 
13488 void
13489  SYS_DMA_Tasks (
13490  SYS_MODULE_OBJ object ,
13491  DMA_CHANNEL activeChannel ) ;
13492 //******************************************************************************
13493 /* For backward compatibility */
13494 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13495  // #ifndef _SYS_DMA_DEFINITIONS_H
13496 /*******************************************************************************
13497  End of File
13498 */
13499 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13500 /* CLOSE_FILE Include File */
13501 
13502 // DOM-IGNORE-BEGIN
13503 // DOM-IGNORE-END
13504 // *****************************************************************************
13505 // *****************************************************************************
13506 // Section: DMA System Service Interface Routines
13507 // *****************************************************************************
13508 // *****************************************************************************
13509 // *****************************************************************************
13510 /* DMA System service Transfer Event Handler Function
13511  Summary:
13512  Pointer to a DMA System service Transfer Event handler function.
13513  Description:
13514  This data type defines a DMA System service Transfer Event Handler Function.
13515  A DMA system service client must register an transfer event handler function of
13516  this type to receive transfer related events from the system service.
13517  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13518  was transferred successfully. The channelHandle parameter contains the channel
13519  handle of the channel on which the transfer was processed.
13520  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13521  not transferred successfully. TThe channelHandle parameter contains the channel
13522  handle of the channel on which the transfer had failed.
13523  The contextHandle parameter contains the context handle that was provided by
13524  the client at the time of registering the event handler. This context handle
13525  can be anything that the client consider helpful or necessary to identify
13526  the client context object associated with the channel of the system
13527  service that generated the event.
13528  The event handler function executes in an interrupt context when DMA is setup
13529  to start operation by an interrupt trigger source. It is recommended of the
13530  application to not perform process intensive operations with in this
13531  function.
13532  Remarks:
13533  None.
13534 */
13535 
13536 typedef
13538 SYS_DMA_CHANNEL_HANDLE handle ,
13539 uintptr_t contextHandle ) ;
13540 // *****************************************************************************
13541 // *****************************************************************************
13542 // Section: Initialization and Task Functions
13543 // *****************************************************************************
13544 // *****************************************************************************
13545 //******************************************************************************
13546 /* Function:
13547  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13548  Summary:
13549  Initializes and Enables the DMA Controller.
13550  Description:
13551  This function Enables the DMA module. Enable/Disable stop in idle mode
13552  feature based on the passed parameter value.
13553  This function initializes the DMA module making it ready for clients to
13554  open and use it. The initialization data is specified by the init parameter.
13555  Precondition:
13556  None.
13557  Parameters:
13558  init - Pointer to the data structure containing any data
13559  necessary to initialize the hardware. This pointer may
13560  be null if no data is required and default
13561  initialization is to be used.
13562  Returns:
13563  If successful, returns a valid handle to the DMA module object.
13564  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13565  Example:
13566  <code>
13567  SYS_MODULE_OBJ objectHandle;
13568  SYS_DMA_INIT initParam;
13569  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13570  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13571  (SYS_MODULE_INIT*)initParam);
13572  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13573  {
13574  // Handle error
13575  }
13576  </code>
13577  Remarks:
13578  This function must be called before any other DMA systems service routines
13579  are called.
13580  Not all features are available on all micro-controllers.
13581 */
13582 
13583 SYS_MODULE_OBJ
13585  const SYS_MODULE_INIT * const init ) ;
13586 // *****************************************************************************
13587 // *****************************************************************************
13588 // Section: Channel Setup and management functions
13589 // *****************************************************************************
13590 // *****************************************************************************
13591 //******************************************************************************
13592 /* Function:
13593  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13594  Summary:
13595  Allocates the specified DMA channel and returns a handle to it.
13596  Description:
13597  This function opens the specified DMA channel and provides a
13598  handle that must be provided to all other client-level operations to
13599  identify the caller and the DMA channel.
13600  Precondition:
13601  Function SYS_DMA_Initialize must have been called before calling this
13602  function.
13603  Parameters:
13604  channel - Channel number requested for allocation.
13605  When channel number specified is DMA_CHANNEL_ANY
13606  a random channel is allocated for DMA transfers.
13607  Returns:
13608  The channel handle for the requested channel number.
13609  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13610  Error can occur.
13611  - if the requested channel number is invalid.
13612  - if the requested channel number is not free.
13613  Example:
13614  <code>
13615  DMA_CHANNEL channel;
13616  SYS_DMA_CHANNEL_HANDLE handle
13617  channel = DMA_CHANNEL_2;
13618  handle = SYS_DMA_ChannelAllocate(channel);
13619  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13620  {
13621  // Failed to allocate the channel
13622  }
13623  else
13624  {
13625  // Proceed with setting up the channel and adding the transfer
13626  }
13627  </code>
13628  Remarks:
13629  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13630  This function must be called before any other DMA channel Setup and management
13631  routines are called
13632 */
13633 
13636  DMA_CHANNEL channel ) ;
13637 //******************************************************************************
13638 /* Function:
13639  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13640  Summary:
13641  Deallocates and frees the channel specified by the handle.
13642  Description:
13643  This function deallocates an allocated-channel of the DMA module,
13644  invalidating the handle.
13645  Precondition:
13646  DMA should have been initialized by calling SYS_DMA_Initialize.
13647  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13648  Parameters:
13649  handle - A valid allocated-channel handle, returned from the service's
13650  Allocate routine
13651  Returns:
13652  None.
13653  Example:
13654  <code>
13655  DMA_CHANNEL channel;
13656  SYS_DMA_CHANNEL_HANDLE handle;
13657  channel = DMA_CHANNEL_2;
13658  handle = SYS_DMA_ChannelAllocate(channel);
13659  SYS_DMA_ChannelRelease(handle);
13660  </code>
13661  Remarks:
13662  After calling this routine, the handle passed in "handle" must not be used
13663  with any of the remaining service's routines. A new handle must be obtained by
13664  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13665 */
13666 
13667 void
13669  SYS_DMA_CHANNEL_HANDLE handle ) ;
13670 //******************************************************************************
13671 /* Function:
13672  void SYS_DMA_ChannelSetup
13673  (
13674  SYS_DMA_CHANNEL_HANDLE handle,
13675  SYS_DMA_CHANNEL_OP_MODE modeEnable
13676  DMA_TRIGGER_SOURCE eventSrc
13677  )
13678  Summary:
13679  Setup the DMA channel parameters.
13680  Description:
13681  This function sets up the DMA channel parameters.
13682  It sets the channel priority and enables the mode of operations for the
13683  current system design.
13684  Precondition:
13685  DMA should have been initialized by calling SYS_DMA_Initialize.
13686  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13687  Parameters:
13688  handle - Handle of the DMA channel as returned by the
13689  SYS_DMA_ChannelAllocate function.
13690  priority - The priority to be associated to the channel.
13691  modeEnable - The supported operating modes to be enabled.
13692  This parameter can be logically ORed to specify
13693  multiple options.
13694  eventSrc - The event causing the cell transfer start.
13695  Returns:
13696  None.
13697  Example:
13698  <code>
13699  // 'handle' is a valid handle returned
13700  // by the SYS_DMA_ChannelAllocate function.
13701  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13702  DMA_TRIGGER_SOURCE eventSrc;
13703  channel = DMA_CHANNEL_2;
13704  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13705  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13706  // Setup channel number, and enables basic and CRC mode
13707  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13708  </code>
13709  Remarks:
13710  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13711  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13712  mode setup API's needs to be called to set the related parameters.
13713  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13714  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13715  Not all features are available on all microcontrollers.
13716  */
13717 
13718 void
13720  SYS_DMA_CHANNEL_HANDLE handle ,
13721  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13722  DMA_TRIGGER_SOURCE eventSrc ) ;
13723 //******************************************************************************
13724 /* Function:
13725  void SYS_DMA_ChannelSetupMatchAbortMode
13726  (
13727  SYS_DMA_CHANNEL_HANDLE handle,
13728  uint16_t pattern,
13729  DMA_PATTERN_LENGTH length,
13730  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13731  uint8_t ignorePattern
13732  )
13733  Summary:
13734  Setup the pattern match abort mode.
13735  Description:
13736  This function sets up the termination of DMA operation when the specified
13737  pattern is matched. Additionally on supported parts the function also
13738  sets up the ignoring of part of a pattern(8-bit) from match abort
13739  pattern(16-bit).
13740  Precondition:
13741  DMA should have been initialized by calling SYS_DMA_Initialize.
13742  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13743  The function SYS_DMA_ChannelSetup must be called to enable
13744  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13745  match mode features.
13746  Parameters:
13747  handle - Handle of the DMA channel as returned by the
13748  SYS_DMA_ChannelAllocate function.
13749  pattern - The pattern that needs to be matched to abort a DMA transfer.
13750  length - Match pattern length can be 1-byte or 2-byte.
13751  ignore - Enable/Disable a byte between a 2-byte pattern match.
13752  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13753  from the match abort pattern(16-bit)
13754  Returns:
13755  None.
13756  Example:
13757  <code>
13758  // Example 1
13759  // The following code is for a device with an 8-bit pattern value and no
13760  // support for pattern match ignore feature
13761  // 'handle' is a valid handle returned
13762  // by the SYS_DMA_ChannelAllocate function.
13763  uint16_t pattern;
13764  DMA_PATTERN_LENGTH length;
13765  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13766  uint8_t ignorePattern;
13767  pattern = 0x00; //Stop transfer on detection of a NULL character
13768  length = DMA_PATTERN_LENGTH_NONE;
13769  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13770  ignorePattern = 0;
13771  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13772  ignoreEnable, ignorePattern);
13773  // Example 2
13774  // The following code is for a device with a 16-bit pattern value and
13775  // support for pattern match ignore feature
13776  // 'handle' is a valid handle returned
13777  // by the SYS_DMA_ChannelAllocate function.
13778  uint16_t pattern;
13779  DMA_PATTERN_LENGTH length;
13780  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13781  uint8_t ignorePattern;
13782  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13783  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13784  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13785  ignorePattern = 0x00; \\ Any null character between the termination pattern
13786  \\ '\r' and '\n' is ignored.
13787  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13788  ignore, ignorePattern);
13789  </code>
13790  Remarks:
13791  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13792  Not all features are available on all devices.
13793  Refer to the specific device data sheet for details.
13794 */
13795 
13796 void
13798  SYS_DMA_CHANNEL_HANDLE handle ,
13799  uint16_t pattern ,
13800  DMA_PATTERN_LENGTH length ,
13802  uint8_t ignorePattern ) ;
13803 //******************************************************************************
13804 /* Function:
13805  void SYS_DMA_ChannelCRCSet
13806  (
13807  SYS_DMA_CHANNEL_HANDLE handle,
13808  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13809  )
13810  Summary:
13811  Sets up the CRC operation mode.
13812  Description:
13813  This function sets up the CRC computation features.
13814  Precondition:
13815  DMA should have been initialized by calling SYS_DMA_Initialize.
13816  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13817  The function SYS_DMA_ChannelSetup must be called to enable
13818  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13819  Parameters:
13820  handle - Handle of the DMA channel as returned by the
13821  SYS_DMA_ChannelAllocate function.
13822  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13823  crc.mode - Compute the CRC in Background/Append mode.
13824  crc.polyLength - Denotes the length of the polynomial.
13825  crc.bitOrder - CRC is calculated LSb/MSb first.
13826  crc.byteOrder - Byte selection order input pre-CRC Generator
13827  crc.writeOrder - Write byte order selection post-CRC computation
13828  crc.data - Computed/Seed CRC
13829  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13830  when mode is LFSR
13831  Returns:
13832  None.
13833  Example:
13834  <code>
13835  //Example 1
13836  // DMA calculation using the CRC background mode
13837  // 'handle' is a valid handle returned
13838  // by the SYS_DMA_ChannelAllocate function.
13839  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13840  crc.type = DMA_CRC_LFSR;
13841  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13842  crc.polyLength = 16;
13843  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13844  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13845  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13846  crc.data = 0xFFFF;
13847  crc.xorBitMask = 0x1021;
13848  SYS_DMA_ChannelCRCSet(handle, crc);
13849  </code>
13850  Remarks:
13851  This feature may not be available on all devices. Refer to the specific device
13852  data sheet to determine availability.
13853 */
13854 
13855 void
13857  SYS_DMA_CHANNEL_HANDLE handle ,
13859 //******************************************************************************
13860 /* Function:
13861  uint32_t SYS_DMA_ChannelCRCGet(void)
13862  Summary:
13863  Returns the computed CRC.
13864  Description:
13865  This function returns the computed CRC
13866  Precondition:
13867  DMA should have been initialized by calling SYS_DMA_Initialize.
13868  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13869  The function SYS_DMA_ChannelSetup must be called to enable
13870  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13871  The CRC generator must have been previously setup using
13872  SYS_DMA_ChannelCRCSet.
13873  Parameters:
13874  None
13875  Returns:
13876  uint32_t - The Computed CRC.
13877  Example:
13878  <code>
13879  uint32_t computedCRC;
13880  computedCRC = SYS_DMA_ChannelCRCGet();
13881  </code>
13882  Remarks:
13883  To get the computed CRC value this function must be called after the block
13884  transfer completion event (i.e., after getting and processing the callback
13885  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13886  This feature may not be available on all devices. Refer to the specific device
13887  data sheet to determine availability.
13888 */
13889 
13890 uint32_t
13891  SYS_DMA_ChannelCRCGet ( void ) ;
13892 //******************************************************************************
13893 /* Function:
13894  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13895  Summary:
13896  Enables a channel.
13897  Description:
13898  This function enables a channel.
13899  Precondition:
13900  DMA should have been initialized by calling SYS_DMA_Initialize.
13901  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13902  The function SYS_DMA_ChannelSetup must have been called to setup and
13903  enable the required features.
13904  Parameters:
13905  handle - Handle of the DMA channel as returned by the
13906  SYS_DMA_ChannelAllocate function.
13907  Returns:
13908  None.
13909  Example:
13910  <code>
13911  // 'handle' is a valid handle returned
13912  // by the SYS_DMA_ChannelAllocate function.
13913  SYS_DMA_ChannelEnable(handle);
13914  </code>
13915  Remarks:
13916  This function may not required to be called when starting DMA setup
13917  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13918  But may be needed to be called in the registered callback to enable the
13919  channel and continue the data transfer with the existing transfer parameters
13920  previously set with 'SYS_DMA_ChannelTransferAdd'.
13921  The DMA channel is by default disabled on the completion of block
13922  transfer(callback generated)
13923 */
13924 
13925 void
13927  SYS_DMA_CHANNEL_HANDLE handle ) ;
13928 //******************************************************************************
13929 /* Function:
13930  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13931  Summary:
13932  Disables a channel.
13933  Description:
13934  This function disables a channel.
13935  Precondition:
13936  DMA should have been initialized by calling SYS_DMA_Initialize.
13937  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13938  The function SYS_DMA_ChannelSetup must have been called to setup and
13939  enable the required features.
13940  A DMA channel should have been enabled either by calling
13941  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13942  Parameters:
13943  handle - Handle of the DMA channel as returned by the
13944  SYS_DMA_ChannelAllocate function.
13945  Returns:
13946  None.
13947  Example:
13948  <code>
13949  // 'handle' is a valid handle returned
13950  // by the SYS_DMA_ChannelAllocate function.
13951  SYS_DMA_ChannelDisable(handle);
13952  </code>
13953  Remarks:
13954  None.
13955 */
13956 
13957 void
13959  SYS_DMA_CHANNEL_HANDLE handle ) ;
13960 //******************************************************************************
13961 /* Function:
13962  void SYS_DMA_ChannelTransferAdd
13963  (
13964  SYS_DMA_CHANNEL_HANDLE handle,
13965  const void *srcAddr, size_t srcSize
13966  const void *destAddr, size_t destSize,
13967  size_t cellSize
13968  )
13969  Summary:
13970  Adds a data transfer to a DMA channel and Enables the channel to start
13971  data transfer.
13972  Description:
13973  This function adds a data transfer characteristics for a DMA channel. The
13974  The source and the destination addresses, source and destination lengths,
13975  The number of bytes transferred per cell event are set. It also enables
13976  the channel to start data transfer.
13977  If the requesting client registered an event callback with the service,
13978  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13979  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13980  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13981  processed successfully.
13982  Precondition:
13983  DMA should have been initialized by calling SYS_DMA_Initialize.
13984  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13985  The function SYS_DMA_ChannelSetup must have been called to setup and
13986  enable the required features.
13987  Parameters:
13988  handle - Handle of the DMA channel as returned by the
13989  SYS_DMA_ChannelAllocate function.
13990  srcAddr - Source of the DMA transfer
13991  srcSize - Size of the source
13992  destAddr - Destination of the DMA transfer
13993  destSize - Size of the destination
13994  cellSize - Size of the cell
13995  Returns:
13996  None.
13997  Example:
13998  <code>
13999  // Add 10 bytes of data transfer to UART TX
14000  // 'handle' is a valid handle returned
14001  // by the SYS_DMA_ChannelAllocate function.
14002  MY_APP_OBJ myAppObj;
14003  uint8_t buf[10];
14004  void *srcAddr;
14005  void *destAddr;
14006  size_t srcSize;
14007  size_t destSize;
14008  size_t cellSize;
14009  srcAddr = (uint8_t *) buf;
14010  srcSize = 10;
14011  destAddr = (uin8_t*) &U2TXREG;
14012  destSize = 1;
14013  cellSize = 1;
14014  // User registers an event handler with system service. This is done once
14015  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14016  (uintptr_t)&myAppObj);
14017  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14018  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14019  {
14020  // Error handling here
14021  }
14022  // Event Processing Technique. Event is received when
14023  // the transfer is processed.
14024  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14025  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14026  {
14027  switch(event)
14028  {
14029  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14030  // This means the data was transferred.
14031  break;
14032  case SYS_DMA_TRANSFER_EVENT_ERROR:
14033  // Error handling here.
14034  break;
14035  default:
14036  break;
14037  }
14038  }
14039  </code>
14040  Remarks:
14041  For PIC32MZ series of devices, if the source/destination addresses are
14042  RAM memory addresses, the the source/destination buffers
14043  should be made coherent to avoid the cache coherency issues.
14044  For example:
14045  <code>
14046  uint8_t buffer[1024];
14047  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14048  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14049  </code>
14050 */
14051 
14052 void
14054  SYS_DMA_CHANNEL_HANDLE handle ,
14055  const void * srcAddr ,
14056  size_t srcSize ,
14057  const void * destAddr ,
14058  size_t destSize ,
14059  size_t cellSize ) ;
14060 //******************************************************************************
14061 /* Function:
14062  void SYS_DMA_ChannelTransferSet
14063  (
14064  SYS_DMA_CHANNEL_HANDLE handle,
14065  const void *srcAddr, size_t srcSize
14066  const void *destAddr, size_t destSize,
14067  size_t cellSize
14068  )
14069  Summary:
14070  Sets up a data transfer to a DMA channel.
14071  Description:
14072  This function sets up data transfer characteristics for a DMA channel. The
14073  The source and the destination addresses, source and destination lengths,
14074  The number of bytes transferred per cell event are set.
14075  This function does not enables the DMA channel. The channel has to be explicitly
14076  enabled to start the data transfer.
14077  The above functions could be used in situations where in the user intends to
14078  setup transfer parameters but do not intend to enable the channel immediately.
14079  For example to chain to DMA channels in a cyclic order where the channels remains
14080  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14081  condition occurs.
14082  Precondition:
14083  DMA should have been initialized by calling SYS_DMA_Initialize.
14084  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14085  The function SYS_DMA_ChannelSetup must have been called to setup and
14086  enable the required features.
14087  Parameters:
14088  handle - Handle of the DMA channel as returned by the
14089  SYS_DMA_ChannelAllocate function.
14090  srcAddr - Source of the DMA transfer
14091  srcSize - Size of the source
14092  destAddr - Destination of the DMA transfer
14093  destSize - Size of the destination
14094  cellSize - Size of the cell
14095  Returns:
14096  None.
14097  Example:
14098  <code>
14099  // Set up 10 bytes of data transfer to UART TX
14100  // 'handle' is a valid handle returned
14101  // by the SYS_DMA_ChannelAllocate function.
14102  MY_APP_OBJ myAppObj;
14103  uint8_t buf[10];
14104  void *srcAddr;
14105  void *destAddr;
14106  size_t srcSize;
14107  size_t destSize;
14108  size_t cellSize;
14109  srcAddr = (uint8_t *) buf;
14110  srcSize = 10;
14111  destAddr = (uin8_t*) &U2TXREG;
14112  destSize = 1;
14113  cellSize = 1;
14114  // User registers an event handler with system service. This is done once
14115  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14116  (uintptr_t)&myAppObj);
14117  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14118  SYS_DMA_ChannelEnable(handle);
14119  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14120  {
14121  // Error handling here
14122  }
14123  // Event Processing Technique. Event is received when
14124  // the transfer is processed.
14125  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14126  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14127  {
14128  switch(event)
14129  {
14130  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14131  // This means the data was transferred.
14132  break;
14133  case SYS_DMA_TRANSFER_EVENT_ERROR:
14134  // Error handling here.
14135  break;
14136  default:
14137  break;
14138  }
14139  }
14140  </code>
14141  Remarks:
14142  For PIC32MZ series of devices, if the source/destination addresses are
14143  RAM memory addresses, the the source/destination buffers
14144  should be made coherent to avoid the cache coherency issues.
14145  For example:
14146  <code>
14147  uint8_t buffer[1024];
14148  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14149  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14150  </code>
14151 */
14152 
14153 void
14155  SYS_DMA_CHANNEL_HANDLE handle ,
14156  const void * srcAddr ,
14157  size_t srcSize ,
14158  const void * destAddr ,
14159  size_t destSize ,
14160  size_t cellSize ) ;
14161 //******************************************************************************
14162 /* Function:
14163  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14164  Summary:
14165  Returns the number of bytes transferred from source.
14166  Description:
14167  When a data transfer request is submitted. At any time while the transmission
14168  is in progress the size of the amount of data transferred from source
14169  can be known by calling this function.
14170  Precondition:
14171  DMA should have been initialized by calling SYS_DMA_Initialize.
14172  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14173  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14174  SYS_DMA_ChannelTransferSet.
14175  Parameters:
14176  handle - A valid channel handle, returned from the system service's
14177  Allocate routine
14178  Returns:
14179  size_t - Returns the number of bytes transferred from the submitted size.
14180  Example:
14181  <code>
14182  // 'handle' is a valid handle returned
14183  // by the SYS_DMA_ChannelAllocate function.
14184  MY_APP_OBJ myAppObj;
14185  uint8_t buf[10];
14186  void *srcAddr;
14187  void *destAddr;
14188  size_t srcSize;
14189  size_t destSize;
14190  size_t cellSize;
14191  size_t transferredSize;
14192  srcAddr = (uint8_t *) buf;
14193  srcSize = 10;
14194  destAddr = (uin8_t*) &U2TXREG;
14195  destSize = 1;
14196  cellSize = 1;
14197  channelHandle = SYS_DMA_ChannelAllocate(channel);
14198  // User registers an event handler with system service. This is done once
14199  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14200  (uintptr_t)&myAppObj);
14201  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14202  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14203  {
14204  // Error handling here
14205  }
14206  // The data is being transferred after adding the transfer to the DMA channel.
14207  // The user can get to know dynamically the amount of data
14208  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14209  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14210  </code>
14211  Remarks:
14212  None.
14213 */
14214 
14215 size_t
14217  SYS_DMA_CHANNEL_HANDLE handle ) ;
14218 //******************************************************************************
14219 /* Function:
14220  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14221  Summary:
14222  Returns the number of bytes transferred to destination.
14223  Description:
14224  When a data transfer request is submitted. At any time while the transmission
14225  is in progress the size of the amount of data transferred to destination
14226  can be known by calling this function.
14227  Precondition:
14228  DMA should have been initialized by calling SYS_DMA_Initialize.
14229  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14230  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14231  SYS_DMA_ChannelTransferSet.
14232  Parameters:
14233  handle - A valid channel handle, returned from the system service's
14234  Allocate routine
14235  Returns:
14236  size_t - Returns the number of bytes received from the submitted size.
14237  Example:
14238  <code>
14239  // 'handle' is a valid handle returned
14240  // by the SYS_DMA_ChannelAllocate function.
14241  MY_APP_OBJ myAppObj;
14242  uint8_t buf[10];
14243  void *srcAddr;
14244  void *destAddr;
14245  size_t srcSize;
14246  size_t destSize;
14247  size_t cellSize;
14248  size_t transferredSize;
14249  srcAddr = (uin8_t*) &U2RXREG;
14250  srcSize = 1;
14251  destAddr = (uint8_t *) buf ;
14252  destSize = 10;
14253  cellSize = 1;
14254  channelHandle = SYS_DMA_ChannelAllocate(channel);
14255  // User registers an event handler with system service. This is done once
14256  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14257  (uintptr_t)&myAppObj);
14258  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14259  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14260  {
14261  // Error handling here
14262  }
14263  // The data is being transferred after adding the transfer to the DMA channel.
14264  // The user can get to know dynamically the amount of data
14265  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14266  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14267  </code>
14268  Remarks:
14269  None.
14270 */
14271 
14272 size_t
14274  SYS_DMA_CHANNEL_HANDLE handle ) ;
14275 //******************************************************************************
14276 /*
14277  Function:
14278  void SYS_DMA_ChannelTransferEventHandlerSet
14279  (
14280  SYS_DMA_CHANNEL_HANDLE handle,
14281  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14282  const uintptr_t contextHandle
14283  )
14284  Summary:
14285  This function allows a DMA system service client to set an event handler.
14286  Description:
14287  This function allows a client to set an event handler. The client may want
14288  to receive transfer related events in cases when it uses non-blocking read and
14289  write functions. The event handler should be set before the client
14290  intends to perform operations that could generate events.
14291  This function accepts a contextHandle parameter. This parameter could be
14292  set by the client to contain (or point to) any client specific data object
14293  that should be associated with this DMA channel.
14294  Precondition:
14295  DMA should have been initialized by calling SYS_DMA_Initialize.
14296  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14297  Parameters:
14298  handle - A valid channel handle, returned from the system service's
14299  Allocate routine
14300  eventHandler - Pointer to the event handler function.
14301  contextHandle - Value identifying the context of the application/driver/middleware
14302  that registered the event handling function.
14303  Returns:
14304  None.
14305  Example:
14306  <code>
14307  // 'handle' is a valid handle returned
14308  // by the SYS_DMA_ChannelAllocate function.
14309  MY_APP_OBJ myAppObj;
14310  uint8_t buf[10];
14311  void *srcAddr;
14312  void *destAddr;
14313  size_t srcSize;
14314  size_t destSize;
14315  size_t cellSize;
14316  srcAddr = (uint8_t *) buf;
14317  srcSize = 10;
14318  destAddr = (uin8_t*) &U2TXREG;
14319  destSize = 1;
14320  cellSize = 1;
14321  channelHandle = SYS_DMA_ChannelAllocate(channel);
14322  // User registers an event handler with system service. This is done once
14323  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14324  (uintptr_t)&myAppObj);
14325  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14326  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14327  {
14328  // Error handling here
14329  }
14330  // Event Processing Technique. Event is received when
14331  // the transfer is processed.
14332  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14333  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14334  {
14335  switch(event)
14336  {
14337  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14338  // This means the data was transferred.
14339  break;
14340  case SYS_DMA_TRANSFER_EVENT_ERROR:
14341  // Error handling here.
14342  break;
14343  default:
14344  break;
14345  }
14346  }
14347  </code>
14348  Remarks:
14349  None.
14350  */
14351 
14352 void
14354  SYS_DMA_CHANNEL_HANDLE handle ,
14355  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14356  const uintptr_t contextHandle ) ;
14357 // *****************************************************************************
14358 /* Function:
14359  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14360  Summary:
14361  This function returns the error(if any) associated with the last client
14362  request.
14363  Description:
14364  This function returns the error(if any) associated with the last client
14365  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14366  the client can call this function to know the error cause.
14367  The error status will be updated on every operation and should be read
14368  frequently (ideally immediately after the service operation has completed)
14369  to know the relevant error status.
14370  Precondition:
14371  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14372  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14373  handle.
14374  Parameters:
14375  handle - Handle of the DMA channel as returned by the
14376  SYS_DMA_ChannelAllocate function.
14377  Returns:
14378  A SYS_DMA_ERROR type indicating last known error status.
14379  Example:
14380  <code>
14381  // 'handle' is a valid handle returned
14382  // by the SYS_DMA_ChannelAllocate function.
14383  // pDmaSrc, pDmaDst is the source,destination address
14384  // txferSrcSize, txferDesSize is the source,destination transfer size
14385  // cellSize is the cell size
14386  MY_APP_OBJ myAppObj;
14387  // Client registers an event handler with service. This is done once
14388  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14389  (uintptr_t)&myAppObj );
14390  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14391  DMA_TRIGGER_SOURCE_NONE);
14392  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14393  pDmaDst,txferDesSize,cellSize);
14394  SYS_DMA_ChannelForceStart(handle);
14395  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14396  {
14397  // Error handling here
14398  }
14399  // Event Processing Technique. Event is received when
14400  // the transfer is processed.
14401  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14402  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14403  {
14404  switch(event)
14405  {
14406  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14407  // This means the data was transferred.
14408  break;
14409  case SYS_DMA_TRANSFER_EVENT_ERROR:
14410  // Error handling here.
14411  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14412  {
14413  // There was an address error.
14414  // Do error handling here.
14415  }
14416  break;
14417  default:
14418  break;
14419  }
14420  }
14421  </code>
14422  Remarks:
14423  It is the client's responsibility to make sure that the error status is
14424  obtained frequently. The service will update the error status
14425  regardless of whether this has been examined by the client.
14426 */
14427 
14430  SYS_DMA_CHANNEL_HANDLE handle ) ;
14431 //******************************************************************************
14432 /* Function:
14433  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14434  Summary:
14435  Force start of transfer on the selected channel.
14436  Description:
14437  The function force start a DMA transfer to occur for the selected channel.
14438  Precondition:
14439  DMA should have been initialized by calling SYS_DMA_Initialize.
14440  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14441  The function SYS_DMA_ChannelSetup must have been called to setup and
14442  enable the required features.
14443  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14444  Parameters:
14445  handle - Handle of the DMA channel as returned by the
14446  SYS_DMA_ChannelAllocate function.
14447  Returns:
14448  None.
14449  Example:
14450  <code>
14451  // 'handle' is a valid handle returned
14452  // by the SYS_DMA_ChannelAllocate function.
14453  // pDmaSrc, pDmaDst is the source,destination address
14454  // txferSrcSize, txferDesSize is the source,destination transfer size
14455  // cellSize is the cell size
14456  MY_APP_OBJ myAppObj;
14457  // Client registers an event handler with service. This is done once
14458  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14459  (uintptr_t)&myAppObj );
14460  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14461  DMA_TRIGGER_SOURCE_NONE);
14462  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14463  pDmaDst,txferDesSize,cellSize);
14464  SYS_DMA_ChannelForceStart(handle);
14465  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14466  {
14467  // Error handling here
14468  }
14469  // Event Processing Technique. Event is received when
14470  // the transfer is processed.
14471  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14472  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14473  {
14474  switch(event)
14475  {
14476  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14477  // This means the data was transferred.
14478  break;
14479  case SYS_DMA_TRANSFER_EVENT_ERROR:
14480  // Error handling here.
14481  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14482  {
14483  // There was an address error.
14484  // Do error handling here.
14485  }
14486  break;
14487  default:
14488  break;
14489  }
14490  }
14491  </code>
14492  Remarks:
14493  This function must be used to start the DMA transfer when the channel has been
14494  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14495 */
14496 
14497 void
14499  SYS_DMA_CHANNEL_HANDLE handle ) ;
14500 //******************************************************************************
14501 /* Function:
14502  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14503  Summary:
14504  Force abort of transfer on the selected channel.
14505  Description:
14506  The function aborts a DMA transfer to occur for the selected channel.
14507  Precondition:
14508  DMA should have been initialized by calling SYS_DMA_Initialize.
14509  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14510  The function SYS_DMA_ChannelSetup must have been called to setup and
14511  enable the required features.
14512  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14513  Parameters:
14514  handle - Handle of the DMA channel as returned by the
14515  SYS_DMA_ChannelAllocate function.
14516  Returns:
14517  None.
14518  Example:
14519  <code>
14520  // 'handle' is a valid handle returned
14521  // by the SYS_DMA_ChannelAllocate function.
14522  // pDmaSrc, pDmaDst is the source,destination address
14523  // txferSrcSize, txferDesSize is the source,destination transfer size
14524  // cellSize is the cell size
14525  MY_APP_OBJ myAppObj;
14526  // Client registers an event handler with service. This is done once
14527  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14528  (uintptr_t)&myAppObj );
14529  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14530  DMA_TRIGGER_SOURCE_NONE);
14531  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14532  pDmaDst,txferDesSize,cellSize);
14533  SYS_DMA_ChannelForceStart(handle);
14534  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14535  {
14536  // Error handling here
14537  }
14538  ....
14539  ....
14540  // Client may need to abort a transfer
14541  SYS_DMA_ChannelForceAbort(handle);
14542  // Event Processing Technique. Event is received when
14543  // the transfer is processed.
14544  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14545  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14546  {
14547  switch(event)
14548  {
14549  case SYS_DMA_TRANSFER_EVENT_ABORT:
14550  // This means the data was transferred.
14551  break;
14552  case SYS_DMA_TRANSFER_EVENT_ERROR:
14553  // Error handling here.
14554  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14555  {
14556  // There was an address error.
14557  // Do error handling here.
14558  }
14559  break;
14560  default:
14561  break;
14562  }
14563  }
14564  </code>
14565  Remarks:
14566  This function must be used to abort the DMA transfer when the channel has been
14567  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14568  and SYS_DMA_ChannelAbortEventSet has not been called.
14569 */
14570 
14571 void
14573  SYS_DMA_CHANNEL_HANDLE handle ) ;
14574 //******************************************************************************
14575 /* Function:
14576  void SYS_DMA_ChannelAbortEventSet
14577  (
14578  SYS_DMA_CHANNEL_HANDLE handle,
14579  DMA_TRIGGER_SOURCE eventSrc
14580  )
14581  Summary:
14582  Sets an event source and enables cell transfer abort event for the same
14583  for the selected channel.
14584  Description:
14585  This functions enables a cell transfer abort event for the selected source
14586  event.
14587  Precondition:
14588  DMA should have been initialized by calling SYS_DMA_Initialize.
14589  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14590  The function SYS_DMA_ChannelSetup must have been called to setup and
14591  enable the required features.
14592  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14593  Parameters:
14594  handle - Handle of the DMA channel as returned by the
14595  SYS_DMA_ChannelAllocate function.
14596  eventSrc - The event causing the cell transfer abort
14597  Returns:
14598  None.
14599  Example:
14600  <code>
14601  // 'handle' is a valid handle returned
14602  // by the SYS_DMA_ChannelAllocate function.
14603  // pDmaSrc, pDmaDst is the source,destination address
14604  // txferSrcSize, txferDesSize is the source,destination transfer size
14605  // cellSize is the cell size
14606  MY_APP_OBJ myAppObj;
14607  // Client registers an event handler with service. This is done once
14608  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14609  (uintptr_t)&myAppObj );
14610  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14611  DMA_TRIGGER_SOURCE_NONE);
14612  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14613  pDmaDst,txferDesSize,cellSize);
14614  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14615  SYS_DMA_ChannelForceStart(handle);
14616  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14617  {
14618  // Error handling here
14619  }
14620  // Event Processing Technique. Event is received when
14621  // the transfer is processed.
14622  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14623  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14624  {
14625  switch(event)
14626  {
14627  case SYS_DMA_TRANSFER_EVENT_ABORT:
14628  // This means the data was transferred.
14629  break;
14630  case SYS_DMA_TRANSFER_EVENT_ERROR:
14631  // Error handling here.
14632  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14633  {
14634  // There was an address error.
14635  // Do error handling here.
14636  }
14637  break;
14638  default:
14639  break;
14640  }
14641  }
14642  </code>
14643  Remarks:
14644  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14645  current DMA transfer will be aborted. The behavior is a same as calling
14646  SYS_DMA_ChannelForceAbort.
14647 */
14648 
14649 void
14651  SYS_DMA_CHANNEL_HANDLE handle ,
14652  DMA_TRIGGER_SOURCE eventSrc ) ;
14653 //******************************************************************************
14654 /* Function:
14655  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14656  Summary:
14657  Returns the busy status of the specified DMA channel.
14658  Description:
14659  This function returns the busy status of the selected DMA channel
14660  Precondition:
14661  DMA should have been initialized by calling SYS_DMA_Initialize.
14662  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14663  Parameters:
14664  handle - Handle of the DMA channel as returned by the
14665  SYS_DMA_ChannelAllocate function.
14666  Returns:
14667  bool - true, if the selected DMA channel is active or enabled
14668  - false, if the selected DMA channel is inactive or disabled
14669  Example:
14670  <code>
14671  bool busyStat;
14672  busyStat = SYS_DMA_ChannelGetBusy(handle);
14673  </code>
14674  Remarks:
14675  This feature may not be available on all devices. Refer to the specific device
14676  data sheet to determine availability.
14677 */
14678 
14679 bool
14681  SYS_DMA_CHANNEL_HANDLE handle ) ;
14682 //******************************************************************************
14683 /* Function:
14684  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14685  Summary:
14686  Suspend DMA operation on the specified DMA channel.
14687  Description:
14688  This function suspends the DMA operation on the DMA channel
14689  specified by the channel handle.
14690  Precondition:
14691  DMA should have been initialized by calling SYS_DMA_Initialize.
14692  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14693  Parameters:
14694  handle - Handle of the DMA channel as returned by the
14695  SYS_DMA_ChannelAllocate function.
14696  Returns:
14697  None.
14698  Example:
14699  <code>
14700  SYS_DMA_ChannelSuspend(handle);
14701  </code>
14702  Remarks:
14703  This feature may not be available on all devices. Refer to the specific device
14704  data sheet to determine availability.
14705 */
14706 
14707 void
14709  SYS_DMA_CHANNEL_HANDLE handle ) ;
14710 //******************************************************************************
14711 /* Function:
14712  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14713  Summary:
14714  Resume DMA operation on the specified DMA channel.
14715  Description:
14716  This function resumes the DMA operation on the DMA channel
14717  specified by the channel handle.
14718  Precondition:
14719  DMA should have been initialized by calling SYS_DMA_Initialize.
14720  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14721  Parameters:
14722  handle - Handle of the DMA channel as returned by the
14723  SYS_DMA_ChannelAllocate function.
14724  Returns:
14725  None.
14726  Example:
14727  <code>
14728  SYS_DMA_ChannelResume(handle);
14729  </code>
14730  Remarks:
14731  This feature may not be available on all devices. Refer to the specific device
14732  data sheet to determine availability.
14733 */
14734 
14735 void
14737  SYS_DMA_CHANNEL_HANDLE handle ) ;
14738 // *****************************************************************************
14739 // *****************************************************************************
14740 // Section: Global DMA Management Functions
14741 // *****************************************************************************
14742 // *****************************************************************************
14743 //******************************************************************************
14744 /* Function:
14745  void SYS_DMA_Suspend(void)
14746  Summary:
14747  Suspend DMA transfers.
14748  Description:
14749  This function suspends DMA transfers to allow CPU uninterrupted access
14750  to data bus
14751  Precondition:
14752  DMA should have been initialized by calling SYS_DMA_Initialize.
14753  Parameters:
14754  None.
14755  Returns:
14756  None.
14757  Example:
14758  <code>
14759  SYS_DMA_Suspend();
14760  </code>
14761  Remarks:
14762  None
14763 */
14764 
14765 void
14766  SYS_DMA_Suspend ( void ) ;
14767 //******************************************************************************
14768 /* Function:
14769  void SYS_DMA_Resume(void)
14770  Summary:
14771  Resume DMA operations.
14772  Description:
14773  This function disables DMA suspend. It resumes the DMA operation suspended
14774  by calling SYS_DMA_Suspend. The DMA operates normally.
14775  Precondition:
14776  DMA should have been initialized by calling SYS_DMA_Initialize.
14777  Parameters:
14778  None.
14779  Returns:
14780  None.
14781  Example:
14782  <code>
14783  SYS_DMA_Resume();
14784  </code>
14785  Remarks:
14786  None
14787 */
14788 
14789 void
14790  SYS_DMA_Resume ( void ) ;
14791 //******************************************************************************
14792 /* Function:
14793  bool SYS_DMA_IsBusy(void)
14794  Summary:
14795  Returns the busy status of the DMA module.
14796  Description:
14797  This function returns the busy status of the DMA module
14798  Precondition:
14799  DMA should have been initialized by calling SYS_DMA_Initialize.
14800  Parameters:
14801  None.
14802  Returns:
14803  Boolean
14804  - true - The DMA module is active
14805  - false - The DMA module is inactive and disabled
14806  <code>
14807  bool busyStat;
14808  busyStat = SYS_DMA_IsBusy();
14809  </code>
14810  Remarks:
14811  This feature may not be available on all devices. Refer to the specific device
14812  data sheet to determine availability.
14813 */
14814 
14815 bool
14816  SYS_DMA_IsBusy ( void ) ;
14817 // *****************************************************************************
14818 // *****************************************************************************
14819 // Section: Deprecated functions
14820 // *****************************************************************************
14821 // *****************************************************************************
14822 //*******************************************************************************
14823 /* Function:
14824  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14825  Summary:
14826  This function is deprecated. Use SYS_DMA_Tasks function.
14827  */
14828 
14829 void
14830  SYS_DMA_Tasks (
14831  SYS_MODULE_OBJ object ,
14832  DMA_CHANNEL activeChannel ) ;
14833 //*****************************************************************************
14834 /* Function:
14835  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14836  Summary:
14837  This function is deprecated. Use SYS_DMA_Tasks function.
14838  */
14839 
14840 void
14842  SYS_MODULE_OBJ object ) ;
14843 //*******************************************************************************
14844 /* Function:
14845  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14846  Summary:
14847  This function is deprecated. Use SYS_DMA_Tasks function.
14848  */
14849 
14850 void
14852  SYS_MODULE_OBJ object ,
14853  DMA_CHANNEL activeChannel ) ;
14854  // #ifndef _SYS_DMA_H
14855 /*******************************************************************************
14856  End of File
14857 */
14858 
14859 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14860 /* CLOSE_FILE Include File */
14861 
14862 // DOM-IGNORE-BEGIN
14863 // DOM-IGNORE-END
14864 // *****************************************************************************
14865 // *****************************************************************************
14866 // Section: Data Types
14867 // *****************************************************************************
14868 // *****************************************************************************
14869 // *****************************************************************************
14870 /* Driver USART Module Index
14871  Summary:
14872  USART driver index definitions
14873  Description:
14874  These constants provide USART driver index definitions.
14875  Remarks:
14876  These constants should be used in place of hard-coded numeric literals.
14877  These values should be passed into the DRV_USART_Initialize and
14878  DRV_USART_Open routines to identify the driver instance in use.
14879 */
14880 #define DRV_USART_INDEX_0 0
14881 #define DRV_USART_INDEX_1 1
14882 #define DRV_USART_INDEX_2 2
14883 #define DRV_USART_INDEX_3 3
14884 #define DRV_USART_INDEX_4 4
14885 #define DRV_USART_INDEX_5 5
14886 // *****************************************************************************
14887 /* USART Driver Module Count
14888  Summary:
14889  Number of valid USART drivers
14890  Description:
14891  This constant identifies the maximum number of USART Driver instances that
14892  should be defined in the system. Defining more instances than this
14893  constant will waste RAM memory space.
14894  This constant can also be used by the system and application to identify the
14895  number of USART instances on this microcontroller.
14896  Remarks:
14897  This value is part-specific.
14898 */
14899 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14900 // *****************************************************************************
14901 /* USART Driver Write Error
14902  Summary:
14903  USART Driver Write Error.
14904  Description:
14905  This constant is returned by DRV_USART_Write() function when an error
14906  occurs.
14907  Remarks:
14908  None.
14909 */
14910 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14911 // *****************************************************************************
14912 /* USART Driver Read Error
14913  Summary:
14914  USART Driver Read Error.
14915  Description:
14916  This constant is returned by DRV_USART_Read() function when an error
14917  occurs.
14918  Remarks:
14919  None.
14920 */
14921 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14922 // *****************************************************************************
14923 /* USART Driver Buffer Handle
14924  Summary:
14925  Handle identifying a read or write buffer passed to the driver.
14926  Description:
14927  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14928  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14929  buffer passed into the function and it allows the application to track the
14930  completion of the data from (or into) that buffer. The buffer handle value
14931  returned from the "buffer add" function is returned back to the client
14932  by the "event handler callback" function registered with the driver.
14933  The buffer handle assigned to a client request expires when the client has
14934  been notified of the completion of the buffer transfer (after event handler
14935  function that notifies the client returns) or after the buffer has been
14936  retired by the driver if no event handler callback was set.
14937  Remarks:
14938  None
14939 */
14940 
14941 typedef
14942 uintptr_t
14944 // *****************************************************************************
14945 /* USART Driver Invalid Buffer Handle
14946  Summary:
14947  Definition of an invalid buffer handle.
14948  Description:
14949  This is the definition of an invalid buffer handle. An invalid buffer handle
14950  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14951  functions if the buffer add request was not successful.
14952  Remarks:
14953  None
14954 */
14955 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14956 // *****************************************************************************
14957 /* USART Modes of Operation
14958  Summary:
14959  Identifies the modes of the operation of the USART module
14960  Description:
14961  This data type identifies the modes of the operation of the USART module.
14962  Remarks:
14963  Not all modes are available on all devices. Refer to the specific device data
14964  sheet to determine availability.
14965 */
14966 
14967 typedef
14968  enum
14969  {
14970  /* USART works in IRDA mode */
14972  /* This is the normal point to point communication mode where the USART
14973  communicates directly with another USART by connecting it's Transmit signal
14974  to the external USART's Receiver signal and vice versa. An external
14975  transceiver may be connected to obtain RS-232 signal levels. This type of
14976  connection is typically full duplex. */
14978  /* This is a multi-point bus mode where the USART can communicate with
14979  many other USARTS on a bus using an address-based protocol such as RS-485.
14980  This mode is typically half duplex and the physical layer may require a
14981  transceiver. In this mode every USART on the bus is assigned an address and
14982  the number of data bits is 9 bits */
14984  /* Loopback mode internally connects the Transmit signal to the Receiver
14985  signal, looping data transmission back into this USART's own input. It is
14986  useful primarily as a test mode. */
14989 // *****************************************************************************
14990 /* USART Driver Buffer Events
14991  Summary
14992  Identifies the possible events that can result from a buffer add request.
14993  Description
14994  This enumeration identifies the possible events that can result from a
14995  buffer add request caused by the client calling either the
14996  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
14997  Remarks:
14998  One of these values is passed in the "event" parameter of the event
14999  handling callback function that the client registered with the driver by
15000  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15001  transfer request is completed.
15002 */
15003 
15004 typedef
15005  enum
15006  {
15007  /* All data from or to the buffer was transferred successfully. */
15009  /* There was an error while processing the buffer transfer request. */
15011  /* Data transfer aborted (Applicable in DMA mode) */
15014 // *****************************************************************************
15015 /* USART Driver Buffer Result
15016  Summary
15017  Identifies the possible result of the buffer processing.
15018  Description
15019  This enumeration identifies the possible result of the buffer processing.
15020 
15021  Remarks:
15022  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15023  is in the free buffer pool.
15024 */
15025 
15026 typedef
15027  enum
15028  {
15029  /* Buffer handle is not valid*/
15031  /* Buffer handle has expired. */
15033  /* Buffer is removed from the queue succesfully*/
15035  /* Buffer removal failed because of unable to acquire the mutex
15036  * This is applicable in RTOS mode only */
15039 // *****************************************************************************
15040 /* USART Driver Buffer Event Handler Function Pointer
15041  Summary
15042  Pointer to a USART Driver Buffer Event handler function
15043  Description
15044  This data type defines the required function signature for the USART driver
15045  buffer event handling callback function. A client must register a pointer
15046  to a buffer event handling function whose function signature (parameter
15047  and return value types) match the types specified by this function pointer
15048  in order to receive buffer related event calls back from the driver.
15049  The parameters and return values and are described here and
15050  a partial example implementation is provided.
15051  Parameters:
15052  event - Identifies the type of event
15053  bufferHandle - Handle identifying the buffer to which the vent relates
15054  context - Value identifying the context of the application that registered
15055  the event handling function.
15056  Returns:
15057  None.
15058  Example:
15059  <code>
15060  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15061  DRV_USART_BUFFER_HANDLE bufferHandle,
15062  uintptr_t context )
15063  {
15064  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15065  switch(event)
15066  {
15067  case DRV_USART_BUFFER_EVENT_COMPLETE:
15068  // Handle the completed buffer.
15069  break;
15070  case DRV_USART_BUFFER_EVENT_ERROR:
15071  default:
15072  // Handle error.
15073  break;
15074  }
15075  }
15076  </code>
15077  Remarks:
15078  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15079  transferred successfully.
15080  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15081  transferred successfully. The DRV_USART_ErrorGet function can be called to
15082  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15083  called to find out how many bytes were processed.
15084  The bufferHandle parameter contains the buffer handle of the buffer that
15085  associated with the event.
15086  The context parameter contains the a handle to the client context,
15087  provided at the time the event handling function was registered using the
15088  DRV_USART_BufferEventHandlerSet function. This context handle value is
15089  passed back to the client as the "context" parameter. It can be any value
15090  necessary to identify the client context or instance (such as a pointer to
15091  the client's data) instance of the client that made the buffer add request.
15092  The event handler function executes in the driver peripheral's interrupt
15093  context when the driver is configured for interrupt mode operation. It is
15094  recommended of the application to not perform process intensive or blocking
15095  operations with in this function.
15096  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15097  be called in the event handler to add a buffer to the driver queue. These
15098  functions can only be called to add buffers to the driver whose event
15099  handler is running. For example, buffers cannot be added USART2 driver in
15100  USART1 driver event handler.
15101 */
15102 
15103 typedef
15105 DRV_USART_BUFFER_HANDLE bufferHandle ,
15106 uintptr_t context ) ;
15107 // *****************************************************************************
15108 /* USART Driver Byte Event Handler Function Pointer
15109  Summary
15110  Pointer to a USART Driver Byte Event handler function
15111  Description
15112  This data type defines the required function signature for the USART driver
15113  byte event handling callback function. A client must register a pointer to a
15114  byte event handling function whose function signature (parameter and return
15115  value types) match the types specified by this function pointer in order to
15116  receive byte related event calls back from the driver.
15117  Parameters:
15118  index - Identifier for the instance
15119  Returns:
15120  None.
15121  Example:
15122  <code>
15123  void APP_MyUsartTxEventHandler(void)
15124  {
15125  // Handle the transmit byte event
15126  }
15127  </code>
15128  Remarks:
15129  The event handler function executes in the driver peripheral's interrupt
15130  context when the driver is configured for interrupt mode operation. It is
15131  recommended that the application not perform process intensive or blocking
15132  operations with in this function.
15133 */
15134 
15135 typedef
15136 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15137 // *****************************************************************************
15138 /* USART Handshake Modes
15139  Summary:
15140  Identifies the handshaking modes supported by the USART driver.
15141  Description:
15142  This data type identifies the handshaking modes supported by the USART
15143  driver.
15144  Remarks:
15145  Not all modes are available on all devices. Refer to the specific device data
15146  sheet to determine availability.
15147 */
15148 
15149 typedef
15150  enum
15151  {
15152  /* Handshaking occurs in Flow Control Mode */
15153  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15154  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15155  ,
15156  /* Handshaking occurs in Simplex Mode */
15157  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15158  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15159  ,
15160  /* No Handshaking */
15161  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15162  2 /*DOM-IGNORE-END*/
15164 // *****************************************************************************
15165 /* USART Baud Set Result
15166  Summary:
15167  Identifies the results of the baud set function.
15168  Description:
15169  This data type identifies the results of the DRV_USART_BaudSet function.
15170  Remarks:
15171  None.
15172 */
15173 
15174 typedef
15175  enum
15176  {
15177  /* The driver was not able to change the baud */
15178  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15179  - 1 /*DOM-IGNORE-END*/
15180  ,
15181  /* The driver was able to change the baud successfully */
15184 // *****************************************************************************
15185 /* USART Line Control Set Result
15186  Summary:
15187  Identifies the results of the baud set function.
15188  Description:
15189  This data type identifies the results of the DRV_USART_LineControlSet
15190  function.
15191  Remarks:
15192  None.
15193 */
15194 
15195 typedef
15196  enum
15197  {
15198  /* The driver was not able to change the Line Control */
15199  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15200  - 1 /*DOM-IGNORE-END*/
15201  ,
15202  /* The driver was able to change the Line Control successfully */
15205 // *****************************************************************************
15206 /* USART Line Control Modes
15207  Summary:
15208  Identifies the line control modes supported by the USART driver.
15209  Description:
15210  This data type identifies the line control modes supported by the USART
15211  driver. Line control modes define the number of data bits, parity mode, and
15212  the number of stop bits in a USART transmit and receive frames.
15213  Remarks:
15214  The abbreviations used in the labels for the values of this enumeration
15215  follow the format <data><parity><stop>, where:
15216  <data> is the number of data bits
15217  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15218  added to obtain an even number of bits, or "ODD" for one bit
15219  added to obtain an odd number of bits.
15220  <stop> is the number of Stop bits
15221 */
15222 
15223 typedef
15224  enum
15225  {
15226  /* 8 data bits, no parity bit, 1 stop bit */
15227  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15228  USART_8N1 /* DOM-IGNORE-END*/
15229  ,
15230  /* 9 data bits, no parity bit, 1 stop bit */
15231  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15232  USART_9N1 /* DOM-IGNORE-END*/
15233  ,
15234  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15235  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15236  USART_8E1 /* DOM-IGNORE-END*/
15237  ,
15238  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15239  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15240  USART_8E2 /* DOM-IGNORE-END*/
15241  ,
15242  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15243  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15244  USART_8O1 /* DOM-IGNORE-END*/
15245  ,
15246  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15247  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15248  USART_8O2 /* DOM-IGNORE-END*/
15249  ,
15250  /* 8 data bits, no parity bit, 2 stop bit */
15251  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15252  USART_8N2 /* DOM-IGNORE-END*/
15253  ,
15254  /* 9 data bits, no parity bit, 2 stop bit */
15255  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15256  USART_9N2 /* DOM-IGNORE-END*/
15258 // *****************************************************************************
15259 /* USART Initialization flags
15260  Summary:
15261  Flags identifying features that can be enabled when the driver is
15262  initialized.
15263  Description:
15264  This enumeration defines flags identifying features that can be enabled
15265  when the driver is initialized.
15266  Remarks:
15267  These flags can be logically ORed together. They are passed into the
15268  DRV_USART_Initialize function through the "flags" member of the
15269  DRV_USART_INIT structure.
15270 */
15271 
15272 typedef
15273  enum
15274  {
15275  /* Use this if no flags need to be set */
15276  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15277  0 /*DOM-IGNORE-END*/
15278  ,
15279  /* Flag to enable "wake on start" operation. If supported and enabled,
15280  this feature will allow the USART to wake-up the device when a
15281  Start bit is received. This option should be selected only when the
15282  device is to placed in Sleep mode. Note that enabling this bit will
15283  also cause the first received character to be lost. Refer to the specific
15284  device data sheet for more information. */
15286  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15287  ,
15288  /* Flag to enable auto baud detection. If supported and enabled, this
15289  feature will allow the USART to automatically detect the baud rate in
15290  use. */
15291  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15292  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15293  ,
15294  /* Flag to enable stop in idle. If supported and enabled , this
15295  feature will allow the USART to stop when the CPU enters Idle
15296  mode */
15298  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15300 // *****************************************************************************
15301 /* Operation Mode Initialization Data
15302  Summary:
15303  Defines the initialization data required for different operation modes of
15304  USART.
15305  Description:
15306  This data type defines the initialization data required for different
15307  operation modes of the USART.
15308  Remarks:
15309  None
15310 */
15311 
15312 typedef
15313  union
15314  {
15315  /* Initialization for Addressed mode */
15316  struct
15317  {
15318  /* Address of the device. */
15319  uint8_t address ;
15320  } AddressedModeInit ;
15322 // *****************************************************************************
15323 /* USART Driver Errors.
15324  Summary:
15325  Defines the possible errors that can occur during driver operation.
15326  Description:
15327  This data type defines the possible errors that can occur when occur during
15328  USART driver operation. These values are returned by DRV_USART_ErrorGet
15329  function.
15330  Remarks:
15331  None
15332 */
15333 
15334 typedef
15335  enum
15336  {
15337  /* There was no error */
15339  /*DOM-IGNORE-BEGIN*/
15340  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15341  ,
15342  /* This indicates that a parity error has occurred */
15344  /*DOM-IGNORE-BEGIN*/
15345  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15346  ,
15347  /* This indicates that a framing error has occurred */
15349  /*DOM-IGNORE-BEGIN*/
15350  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15351  ,
15352  /* This indicates a receiver overflow has occurred */
15354  /*DOM-IGNORE-BEGIN*/
15355  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15356  ,
15357  /* Channel address error (Applicable in DMA mode) */
15358  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15359  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15360  } DRV_USART_ERROR ;
15361 // *****************************************************************************
15362 /* USART Client-Specific Driver Status
15363  Summary:
15364  Defines the client-specific status of the USART driver.
15365  Description:
15366  This enumeration defines the client-specific status codes of the USART
15367  driver.
15368  Remarks:
15369  Returned by the DRV_USART_ClientStatus function.
15370 */
15371 
15372 typedef
15373  enum
15374  {
15375  /* An error has occurred.*/
15377  /* The driver is closed, no operations for this client are ongoing,
15378  and/or the given handle is invalid. */
15380  /* The driver is currently busy and cannot start additional operations. */
15382  /* The module is running and ready for additional operations */
15385 // *****************************************************************************
15386 /* USART Driver Transfer Flags
15387  Summary
15388  Specifies the status of the receive or transmit
15389  Description
15390  This type specifies the status of the receive or transmit operation.
15391  Remarks:
15392  More than one of these values may be OR'd together to create a complete
15393  status value. To test a value of this type, the bit of interest must be
15394  ANDed with the value and checked to see if the result is non-zero.
15395 */
15396 
15397 typedef
15398  enum
15399  {
15400  /* Indicates that at least one byte of Data has been received */
15402  /*DOM-IGNORE-BEGIN*/
15403  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15404  ,
15405  /* Indicates that the core driver receiver buffer is empty */
15407  /*DOM-IGNORE-BEGIN*/
15408  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15409  ,
15410  /* Indicates that the core driver transmitter buffer is full */
15412  /*DOM-IGNORE-BEGIN*/
15413  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15414  ,
15415  /* Indicates that the core driver transmitter buffer is empty */
15417  /*DOM-IGNORE-BEGIN*/
15418  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15420 // *****************************************************************************
15421 /* USART Driver Initialization Data
15422  Summary:
15423  Defines the data required to initialize or reinitialize the USART driver
15424  Description:
15425  This data type defines the data required to initialize or reinitialize the
15426  USART driver. If the driver is built statically, the members of this data
15427  structure are statically over-ridden by static override definitions in the
15428  system_config.h file.
15429  Remarks:
15430  None.
15431 */
15432 
15433 typedef
15434  struct
15435  {
15436  /* System module initialization data */
15437  SYS_MODULE_INIT moduleInit ;
15438  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15439  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15440  system_config.h header file. */
15441  USART_MODULE_ID usartID ;
15442  /* Identifies the Operation mode of the USART driver. For a static build of
15443  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15444  system_config.h header file. */
15446  /* Data required by the operation mode of the driver. For a static build of
15447  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15448  system_config.h header file. */
15450  /* Flags to enable specific features. Refer to the
15451  description of DRV_USART_INIT_FLAGS for more details. For a static build
15452  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15453  system_config.h header file. */
15454  DRV_USART_INIT_FLAGS flags ;
15455  /* USART module Baud Rate Generator Clock. This typically
15456  the peripheral bus clock frequency. For a static build of the driver,
15457  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15458  header file. */
15459  uint32_t brgClock ;
15460  /* The initial USART line control settings. For a static build of the driver
15461  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15462  system_config.h header file. */
15463  DRV_USART_LINE_CONTROL lineControl ;
15464  /* Baud Rate value to be used, if not using auto baud. For a static build of
15465  the driver, this is overridden by the DRV_USART_BAUD macro in the
15466  system_config.h header file. */
15467  uint32_t baud ;
15468  /* Handshaking mode. For a static build of the driver, this is overridden by
15469  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15470  DRV_USART_HANDSHAKE handshake ;
15471  /* Lines enabled for the USART operation. For a static build of the driver,
15472  this is overridden by the DRV_USART_LINES_ENABLE macro in
15473  the system_config.h header file.
15474  For PPS parts, pin selection in ports overrides this. */
15475  USART_OPERATION_MODE linesEnable ;
15476  /* Interrupt source ID for the transmitter interrupt. For a static build of
15477  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15478  macro in the system_config.h header. */
15479  INT_SOURCE interruptTransmit ;
15480  /* Interrupt source ID for the receiver interrupt. For a static build of
15481  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15482  macro in the system_config.h header. */
15483  INT_SOURCE interruptReceive ;
15484  /* Interrupt source ID for the error Interrupt. For a static build of the
15485  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15486  in the system_config.h header. */
15487  INT_SOURCE interruptError ;
15488  /* This is the receive buffer queue size. This is the maximum
15489  number of read requests that driver will queue. For a
15490  static build of the driver, this is overridden by the
15491  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15492  unsigned int queueSizeReceive ;
15493  /* This is the transmit buffer queue size. This is the maximum
15494  number of write requests that driver will queue. For a
15495  static build of the driver, this is overridden by the
15496  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15497  unsigned int queueSizeTransmit ;
15498  /* This is the USART transmit DMA channel.
15499  For a static build of the driver, this is overridden by the
15500  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15501  DMA_CHANNEL dmaChannelTransmit ;
15502  /* This is the USART receive DMA channel.
15503  For a static build of the driver, this is overridden by the
15504  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15505  DMA_CHANNEL dmaChannelReceive ;
15506  /* This is the USART transmit DMA channel interrupt.
15507  For a static build of the driver, this is overridden by the
15508  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15509  INT_SOURCE dmaInterruptTransmit ;
15510  /* This is the USART receive DMA channel interrupt.
15511  For a static build of the driver, this is overridden by the
15512  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15513  INT_SOURCE dmaInterruptReceive ;
15514  } DRV_USART_INIT ;
15515 //DOM-IGNORE-BEGIN
15516 //DOM-IGNORE-END
15517  // #ifndef _DRV_USART_DEFINITIONS_H
15518 /*******************************************************************************
15519  End of File
15520 */
15521 
15522 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15523 /* CLOSE_FILE Include File */
15524 
15525 // DOM-IGNORE-BEGIN
15526 // DOM-IGNORE-END
15527 // *****************************************************************************
15528 // *****************************************************************************
15529 // Section: USART Driver Module Interface Routines
15530 // *****************************************************************************
15531 // *****************************************************************************
15532 // *****************************************************************************
15533 /* Function:
15534  SYS_MODULE_OBJ DRV_USART_Initialize
15535  (
15536  const SYS_MODULE_INDEX index,
15537  const SYS_MODULE_INIT * const init
15538  )
15539  Summary:
15540  Initializes the USART instance for the specified driver index.
15541  <p><b>Implementation:</b> Static/Dynamic</p>
15542  Description:
15543  This routine initializes the USART driver instance for the specified driver
15544  index, making it ready for clients to open and use it. The initialization
15545  data is specified by the init parameter. The initialization may fail if the
15546  number of driver objects allocated are insufficient or if the specified
15547  driver instance is already initialized. The driver instance index is
15548  independent of the USART module ID. For example, driver instance 0 can be
15549  assigned to USART2. If the driver is built statically, then some of the
15550  initialization parameters are overridden by configuration macros. Refer to
15551  the description of the DRV_USART_INIT data structure for more details on
15552  which members on this data structure are overridden.
15553  Precondition:
15554  None.
15555  Parameters:
15556  index - Identifier for the instance to be initialized
15557  init - Pointer to a data structure containing any data necessary to
15558  initialize the driver.
15559  Returns:
15560  If successful, returns a valid handle to a driver instance object.
15561  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15562  Example:
15563  <code>
15564  // The following code snippet shows an example USART driver initialization.
15565  // The driver is initialized for normal mode and a baud of 300. The
15566  // receive queue size is set to 2 and transmit queue size is set to 3.
15567  DRV_USART_INIT usartInit;
15568  SYS_MODULE_OBJ objectHandle;
15569  usartInit.baud = 300;
15570  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15571  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15572  usartInit.usartID = USART_ID_2;
15573  usartInit.brgClock = 80000000;
15574  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15575  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15576  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15577  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15578  usartInit.queueSizeReceive = 2;
15579  usartInit.queueSizeTransmit = 3;
15580  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15581  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15582  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15583  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15584  {
15585  // Handle error
15586  }
15587  </code>
15588  Remarks:
15589  This routine must be called before any other USART routine is called.
15590  This routine should only be called once during system initialization
15591  unless DRV_USART_Deinitialize is called to deinitialize the driver
15592  instance. This routine will NEVER block for hardware access.
15593 */
15594 
15595 SYS_MODULE_OBJ
15597  const SYS_MODULE_INDEX index ,
15598  const SYS_MODULE_INIT * const init ) ;
15599 // *****************************************************************************
15600 /* Function:
15601  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15602  Summary:
15603  Deinitializes the specified instance of the USART driver module.
15604  <p><b>Implementation:</b> Static/Dynamic</p>
15605  Description:
15606  Deinitializes the specified instance of the USART driver module, disabling
15607  its operation (and any hardware). Invalidates all the internal data.
15608  Precondition:
15609  Function DRV_USART_Initialize should have been called before calling this
15610  function.
15611  Parameters:
15612  object - Driver object handle, returned from the
15613  DRV_USART_Initialize routine
15614  Returns:
15615  None.
15616  Example:
15617  <code>
15618  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15619  SYS_STATUS status;
15620  DRV_USART_Deinitialize(object);
15621  status = DRV_USART_Status(object);
15622  if (SYS_MODULE_DEINITIALIZED != status)
15623  {
15624  // Check again later if you need to know
15625  // when the driver is deinitialized.
15626  }
15627  </code>
15628  Remarks:
15629  Once the Initialize operation has been called, the Deinitialize operation
15630  must be called before the Initialize operation can be called again. This
15631  routine will NEVER block waiting for hardware.
15632 */
15633 
15634 void
15636  SYS_MODULE_OBJ object ) ;
15637 // *****************************************************************************
15638 /* Function:
15639  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15640  Summary:
15641  Gets the current status of the USART driver module.
15642  <p><b>Implementation:</b> Static/Dynamic</p>
15643  Description:
15644  This routine provides the current status of the USART driver module.
15645  Precondition:
15646  Function DRV_USART_Initialize should have been called before calling this
15647  function.
15648  Parameters:
15649  object - Driver object handle, returned from the
15650  DRV_USART_Initialize routine
15651  Returns:
15652  SYS_STATUS_READY - Indicates that the driver is busy with a
15653  previous system level operation and cannot start
15654  another
15655  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15656  deinitialized
15657  Example:
15658  <code>
15659  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15660  SYS_STATUS usartStatus;
15661  usartStatus = DRV_USART _Status(object);
15662  if (SYS_STATUS_READY == usartStatus)
15663  {
15664  // This means the driver can be opened using the
15665  // DRV_USART_Open() function.
15666  }
15667  </code>
15668  Remarks:
15669  A driver can opened only when its status is SYS_STATUS_READY.
15670 */
15671 
15672 SYS_STATUS
15674  SYS_MODULE_OBJ object ) ;
15675 // *****************************************************************************
15676 /* Function:
15677  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15678  Summary:
15679  Maintains the driver's transmit state machine and implements its ISR.
15680  <p><b>Implementation:</b> Static/Dynamic</p>
15681  Description:
15682  This routine is used to maintain the driver's internal transmit state
15683  machine and implement its transmit ISR for interrupt-driven implementations.
15684  In polling mode, this function should be called from the SYS_Tasks
15685  function. In interrupt mode, this function should be called in the transmit
15686  interrupt service routine of the USART that is associated with this USART
15687  driver hardware instance.
15688  Precondition:
15689  The DRV_USART_Initialize routine must have been called for the specified
15690  USART driver instance.
15691  Parameters:
15692  object - Object handle for the specified driver instance (returned from
15693  DRV_USART_Initialize)
15694  Returns:
15695  None.
15696  Example:
15697  <code>
15698  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15699  while (true)
15700  {
15701  DRV_USART_TasksTransmit (object);
15702  // Do other tasks
15703  }
15704  </code>
15705  Remarks:
15706  This routine is normally not called directly by an application. It is
15707  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15708  ISR.
15709  This routine may execute in an ISR context and will never block or access any
15710  resources that may cause it to block.
15711 */
15712 
15713 void
15715  SYS_MODULE_OBJ object ) ;
15716 // *****************************************************************************
15717 /* Function:
15718  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15719  Summary:
15720  Maintains the driver's receive state machine and implements its ISR.
15721  <p><b>Implementation:</b> Static/Dynamic</p>
15722  Description:
15723  This routine is used to maintain the driver's internal receive state machine
15724  and implement its receive ISR for interrupt-driven implementations. In
15725  polling mode, this function should be called from the SYS_Tasks function.
15726  In interrupt mode, this function should be called in the receive interrupt
15727  service routine of the USART that is associated with this USART driver
15728  hardware instance.
15729  Precondition:
15730  The DRV_USART_Initialize routine must have been called for the specified
15731  USART driver instance.
15732  Parameters:
15733  object - Object handle for the specified driver instance (returned from
15734  DRV_USART_Initialize)
15735  Returns:
15736  None.
15737  Example:
15738  <code>
15739  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15740  while (true)
15741  {
15742  DRV_USART_TasksReceive (object);
15743  // Do other tasks
15744  }
15745  </code>
15746  Remarks:
15747  This routine is normally not called directly by an application. It is
15748  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15749  ISR.
15750  This routine may execute in an ISR context and will never block or access any
15751  resources that may cause it to block.
15752 */
15753 
15754 void
15756  SYS_MODULE_OBJ object ) ;
15757 // *****************************************************************************
15758 /* Function:
15759  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15760  Summary:
15761  Maintains the driver's error state machine and implements its ISR.
15762  <p><b>Implementation:</b> Static/Dynamic</p>
15763  Description:
15764  This routine is used to maintain the driver's internal error state machine
15765  and implement its error ISR for interrupt-driven implementations. In
15766  polling mode, this function should be called from the SYS_Tasks function.
15767  In interrupt mode, this function should be called in the error interrupt
15768  service routine of the USART that is associated with this USART driver
15769  hardware instance.
15770  Precondition:
15771  The DRV_USART_Initialize routine must have been called for the specified
15772  USART driver instance.
15773  Parameters:
15774  object - Object handle for the specified driver instance (returned from
15775  DRV_USART_Initialize)
15776  Returns:
15777  None.
15778  Example:
15779  <code>
15780  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15781  while (true)
15782  {
15783  DRV_USART_TasksError (object);
15784  // Do other tasks
15785  }
15786  </code>
15787  Remarks:
15788  This routine is normally not called directly by an application. It is
15789  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15790  ISR.
15791  This routine may execute in an ISR context and will never block or access any
15792  resources that may cause it to block.
15793 */
15794 
15795 void
15797  SYS_MODULE_OBJ object ) ;
15798 // *****************************************************************************
15799 // *****************************************************************************
15800 // Section: USART Driver Client Routines
15801 // *****************************************************************************
15802 // *****************************************************************************
15803 // *****************************************************************************
15804 /* Function:
15805  DRV_HANDLE DRV_USART_Open
15806  (
15807  const SYS_MODULE_INDEX index,
15808  const DRV_IO_INTENT ioIntent
15809  )
15810  Summary:
15811  Opens the specified USART driver instance and returns a handle to it.
15812  <p><b>Implementation:</b> Static/Dynamic</p>
15813  Description:
15814  This routine opens the specified USART driver instance and provides a
15815  handle that must be provided to all other client-level operations to
15816  identify the caller and the instance of the driver. The ioIntent
15817  parameter defines how the client interacts with this driver instance.
15818  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15819  additionally affect the behavior of the DRV_USART_Read and
15820  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15821  then these function will not block even if the required amount of data could
15822  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15823  will block until the required amount of data is processed. If the driver is
15824  configured for polling and bare-metal operation, it will not support
15825  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15826  non-blocking.
15827  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15828  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15829  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15830  client will be able to do both, read and write.
15831  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15832  exclusive access to this client. The driver cannot be opened by any
15833  other client.
15834  Precondition:
15835  Function DRV_USART_Initialize must have been called before calling this
15836  function.
15837  Parameters:
15838  index - Identifier for the object instance to be opened
15839  intent - Zero or more of the values from the enumeration
15840  DRV_IO_INTENT "ORed" together to indicate the intended use
15841  of the driver. See function description for details.
15842  Returns:
15843  If successful, the routine returns a valid open-instance handle (a number
15844  identifying both the caller and the module instance).
15845  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15846  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15847  insufficient.
15848  - if the client is trying to open the driver but driver has been opened
15849  exclusively by another client.
15850  - if the driver hardware instance being opened is not initialized or is
15851  invalid.
15852  - if the client is trying to open the driver exclusively, but has already
15853  been opened in a non exclusive mode by another client.
15854  - if the driver is not ready to be opened, typically when the initialize
15855  routine has not completed execution.
15856  Example:
15857  <code>
15858  DRV_HANDLE handle;
15859  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15860  if (DRV_HANDLE_INVALID == handle)
15861  {
15862  // Unable to open the driver
15863  // May be the driver is not initialized or the initialization
15864  // is not complete.
15865  }
15866  </code>
15867  Remarks:
15868  The handle returned is valid until the DRV_USART_Close routine is called.
15869  This routine will NEVER block waiting for hardware.If the requested intent
15870  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15871  function is thread safe in a RTOS application.
15872 */
15873 
15874 DRV_HANDLE
15875  DRV_USART_Open (
15876  const SYS_MODULE_INDEX index ,
15877  const DRV_IO_INTENT ioIntent ) ;
15878 // *****************************************************************************
15879 /* Function:
15880  void DRV_USART_Close( DRV_Handle handle )
15881  Summary:
15882  Closes an opened-instance of the USART driver.
15883  <p><b>Implementation:</b> Static/Dynamic</p>
15884  Description:
15885  This routine closes an opened-instance of the USART driver, invalidating the
15886  handle. Any buffers in the driver queue that were submitted by this client
15887  will be removed. After calling this routine, the handle passed in "handle"
15888  must not be used with any of the remaining driver routines (with one
15889  possible exception described in the "Remarks" section). A new handle must
15890  be obtained by calling DRV_USART_Open before the caller may use the driver
15891  again
15892  Precondition:
15893  The DRV_USART_Initialize routine must have been called for the specified
15894  USART driver instance.
15895  DRV_USART_Open must have been called to obtain a valid opened device handle.
15896  Parameters:
15897  handle - A valid open-instance handle, returned from the driver's
15898  open routine
15899  Returns:
15900  None.
15901  Example:
15902  <code>
15903  DRV_HANDLE handle; // Returned from DRV_USART_Open
15904  DRV_USART_Close(handle);
15905  // After this point, the handle cannot be used with any other function
15906  // except the DRV_USART_ClientStatus function, which can be used to query
15907  // the success status of the DRV_USART_Close function.
15908  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15909  </code>
15910  Remarks:
15911  Usually there is no need for the client to verify that the Close operation
15912  has completed. The driver will abort any ongoing operations when this
15913  routine is called. However, if it requires additional time to do so in a
15914  non-blocking environment, it will still return from the Close operation but
15915  the handle is now a zombie handle. The client can only call the
15916  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15917  Close operation. The DRV_USART_ClientStatus routine will return
15918  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15919 */
15920 
15921 void
15922  DRV_USART_Close (
15923  const DRV_HANDLE handle ) ;
15924 // *****************************************************************************
15925 /*
15926  Function:
15927  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15928  Summary:
15929  Gets the current client-specific status the USART driver.
15930  <p><b>Implementation:</b> Static/Dynamic</p>
15931  Description:
15932  This function gets the client-specific status of the USART driver associated
15933  with the given handle. This function can be used to check the status of
15934  client after the DRV_USART_Close() function has been called.
15935  Preconditions:
15936  The DRV_USART_Initialize function must have been called.
15937  DRV_USART_Open must have been called to obtain a valid opened device
15938  handle.
15939  Parameters:
15940  handle - Handle returned from the driver's open function.
15941  Returns:
15942  A DRV_USART_CLIENT_STATUS value describing the current status of the
15943  driver.
15944  Example:
15945  <code>
15946  DRV_HANDLE handle; // Returned from DRV_USART_Open
15947  DRV_USART_CLIENT_STATUS status;
15948  status = DRV_USART_ClientStatus(handle);
15949  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15950  {
15951  // The client had not closed.
15952  }
15953  </code>
15954  Remarks:
15955  This function will not block for hardware access and will immediately return
15956  the current status. This function is thread safe when called in a RTOS
15957  application.
15958 */
15959 
15962  DRV_HANDLE handle ) ;
15963 // *****************************************************************************
15964 // *****************************************************************************
15965 // Section: USART Driver Buffer Queuing Model Interface Routines
15966 // *****************************************************************************
15967 // *****************************************************************************
15968 // *****************************************************************************
15969 /* Function:
15970  void DRV_USART_BufferAddWrite
15971  (
15972  const DRV_HANDLE handle,
15973  DRV_USART_BUFFER_HANDLE * bufferHandle,
15974  void * buffer,
15975  size_t size
15976  );
15977  Summary:
15978  Schedule a non-blocking driver write operation.
15979  <p><b>Implementation:</b> Static/Dynamic</p>
15980  Description:
15981  This function schedules a non-blocking write operation. The function returns
15982  with a valid buffer handle in the bufferHandle argument if the write request
15983  was scheduled successfully. The function adds the request to the hardware
15984  instance transmit queue and returns immediately. While the request is in the
15985  queue, the application buffer is owned by the driver and should not be
15986  modified. On returning, the bufferHandle parameter may be
15987  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15988  - if a buffer could not be allocated to the request
15989  - if the input buffer pointer is NULL
15990  - if the client opened the driver for read-only
15991  - if the buffer size is 0
15992  - if the transmit queue is full or the queue depth is insufficient
15993  If the requesting client registered an event callback with the driver, the
15994  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
15995  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
15996  was not processed successfully.
15997  Precondition:
15998  The DRV_USART_Initialize routine must have been called for the specified
15999  USART device instance and the DRV_USART_Status must have returned
16000  SYS_STATUS_READY.
16001  DRV_USART_Open must have been called to obtain a valid opened device handle.
16002  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16003  the DRV_USART_Open call.
16004  Parameters:
16005  handle - Handle of the communication channel as return by the
16006  DRV_USART_Open function.
16007  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16008  buffer - Data to be transmitted.
16009  size - Buffer size in bytes.
16010  Returns:
16011  The bufferHandle parameter will contain the return buffer handle. This will be
16012  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16013  Example:
16014  <code>
16015  MY_APP_OBJ myAppObj;
16016  uint8_t mybuffer[MY_BUFFER_SIZE];
16017  DRV_USART_BUFFER_HANDLE bufferHandle;
16018  // myUSARTHandle is the handle returned
16019  // by the DRV_USART_Open function.
16020  // Client registers an event handler with driver
16021  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16022  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16023  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16024  myBuffer, MY_BUFFER_SIZE);
16025  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16026  {
16027  // Error handling here
16028  }
16029  // Event is received when
16030  // the buffer is processed.
16031  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16032  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16033  {
16034  // contextHandle points to myAppObj.
16035  switch(event)
16036  {
16037  case DRV_USART_BUFFER_EVENT_COMPLETE:
16038  // This means the data was transferred.
16039  break;
16040  case DRV_USART_BUFFER_EVENT_ERROR:
16041  // Error handling here.
16042  break;
16043  default:
16044  break;
16045  }
16046  }
16047  </code>
16048  Remarks:
16049  This function is thread safe in a RTOS application. It can be called from
16050  within the USART Driver Buffer Event Handler that is registered by this
16051  client. It should not be called in the event handler associated with another
16052  USART driver instance. It should not otherwise be called directly in an ISR.
16053 */
16054 
16055 void
16057  const DRV_HANDLE handle ,
16058  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16059  void * buffer ,
16060  const size_t size ) ;
16061 // *****************************************************************************
16062 /* Function:
16063  void DRV_USART_AddressedBufferAddWrite
16064  (
16065  const DRV_HANDLE hClient,
16066  DRV_USART_BUFFER_HANDLE * bufferHandle,
16067  uint8_t address,
16068  void * source,
16069  size_t nWords
16070  );
16071  Summary:
16072  Schedule a non-blocking addressed driver write operation.
16073  <p><b>Implementation:</b> Dynamic</p>
16074  Description:
16075  This function schedules a non-blocking addressed write operation. The function returns
16076  with a valid buffer handle in the bufferHandle argument if the addressed write request
16077  was scheduled successfully. The function adds the request to the hardware
16078  instance transmit queue and returns immediately. While the request is in the
16079  queue, the application buffer is owned by the driver and should not be
16080  modified. On returning, the bufferHandle parameter may be
16081  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16082  - if a buffer could not be allocated to the request
16083  - if the input buffer pointer is NULL
16084  - if the client opened the driver for read-only
16085  - if the buffer size is 0
16086  - if the transmit queue is full or the queue depth is insufficient
16087  If the requesting client registered an event callback with the driver, the
16088  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16089  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16090  was not processed successfully.
16091  Precondition:
16092  The DRV_USART_Initialize routine must have been called for the specified
16093  USART device instance and the DRV_USART_Status must have returned
16094  SYS_STATUS_READY.
16095  DRV_USART_Open must have been called to obtain a valid opened device handle.
16096  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16097  the DRV_USART_Open call.
16098  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16099  Parameters:
16100  hClient - Handle of the communication channel as return by the
16101  DRV_USART_Open function.
16102  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16103  address - Address of the receiver client
16104  source - Data to be transmitted.
16105  size - Buffer size in 16-bit words.
16106  Returns:
16107  The bufferHandle parameter will contain the return buffer handle. This will be
16108  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16109  Example:
16110  <code>
16111  MY_APP_OBJ myAppObj;
16112  uint16_t mybuffer[MY_BUFFER_SIZE];
16113  DRV_USART_BUFFER_HANDLE bufferHandle;
16114  uint8_t clientAddress;
16115  // myUSARTHandle is the handle returned
16116  // by the DRV_USART_Open function.
16117  // Client registers an event handler with driver
16118  clientAddress = 0x60;
16119  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16120  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16121  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16122  myBuffer, MY_BUFFER_SIZE);
16123  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16124  {
16125  // Error handling here
16126  }
16127  // Event is received when
16128  // the buffer is processed.
16129  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16130  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16131  {
16132  // contextHandle points to myAppObj.
16133  switch(event)
16134  {
16135  case DRV_USART_BUFFER_EVENT_COMPLETE:
16136  // This means the data was transferred.
16137  break;
16138  case DRV_USART_BUFFER_EVENT_ERROR:
16139  // Error handling here.
16140  break;
16141  default:
16142  break;
16143  }
16144  }
16145  </code>
16146  Remarks:
16147  This function is thread safe in a RTOS application. It can be called from
16148  within the USART Driver Buffer Event Handler that is registered by this
16149  client. It should not be called in the event handler associated with another
16150  USART driver instance. It should not otherwise be called directly in an ISR.
16151  The source buffer should be a 16-bit word aligned buffer.
16152  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16153 */
16154 
16155 void
16157  const DRV_HANDLE hClient ,
16158  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16159  uint8_t address ,
16160  void * source ,
16161  size_t nWords ) ;
16162 // *****************************************************************************
16163 /* Function:
16164  void DRV_USART_BufferAddRead
16165  (
16166  const DRV_HANDLE handle,
16167  DRV_USART_BUFFER_HANDLE * bufferHandle,
16168  void * buffer,
16169  const size_t size
16170  )
16171  Summary:
16172  Schedule a non-blocking driver read operation.
16173  <p><b>Implementation:</b> Static/Dynamic</p>
16174  Description:
16175  This function schedules a non-blocking read operation. The function returns
16176  with a valid buffer handle in the bufferHandle argument if the read request
16177  was scheduled successfully. The function adds the request to the hardware
16178  instance receive queue and returns immediately. While the request is in the
16179  queue, the application buffer is owned by the driver and should not be
16180  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16181  bufferHandle argument:
16182  - if a buffer could not be allocated to the request
16183  - if the input buffer pointer is NULL
16184  - if the buffer size is 0
16185  - if the read queue size is full or queue depth is insufficient.
16186  - if the driver handle is invalid
16187  If the requesting client registered an event callback with the driver, the
16188  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16189  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16190  was not processed successfully.
16191  Precondition:
16192  The DRV_USART_Initialize routine must have been called for the specified
16193  USART device instance and the DRV_USART_Status must have returned
16194  SYS_STATUS_READY.
16195  DRV_USART_Open must have been called to obtain a valid opened device handle.
16196  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16197  the DRV_USART_Open call.
16198  Parameters:
16199  handle - Handle of the communication channel as returned by the
16200  DRV_USART_Open function.
16201  buffer - Buffer where the received data will be stored.
16202  size - Buffer size in bytes.
16203  Returns:
16204  The buffer handle is returned in the bufferHandle argument. This is
16205  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16206  Example:
16207  <code>
16208  MY_APP_OBJ myAppObj;
16209  uint8_t mybuffer[MY_BUFFER_SIZE];
16210  DRV_USART_BUFFER_HANDLE bufferHandle;
16211  // myUSARTHandle is the handle returned
16212  // by the DRV_USART_Open function.
16213  // Client registers an event handler with driver
16214  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16215  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16216  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16217  myBuffer, MY_BUFFER_SIZE);
16218  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16219  {
16220  // Error handling here
16221  }
16222  // Event is received when
16223  // the buffer is processed.
16224  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16225  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16226  {
16227  // contextHandle points to myAppObj.
16228  switch(event)
16229  {
16230  case DRV_USART_BUFFER_EVENT_COMPLETE:
16231  // This means the data was transferred.
16232  break;
16233  case DRV_USART_BUFFER_EVENT_ERROR:
16234  // Error handling here.
16235  break;
16236  default:
16237  break;
16238  }
16239  }
16240  </code>
16241  Remarks:
16242  This function is thread safe in a RTOS application. It can be called from
16243  within the USART Driver Buffer Event Handler that is registered by the
16244  client. It should not be called in the event handler associated with another
16245  USART driver instance. It should not be called directly in an ISR.
16246 */
16247 
16248 void
16250  const DRV_HANDLE handle ,
16251  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16252  void * buffer ,
16253  const size_t size ) ;
16254 // *****************************************************************************
16255 /* Function:
16256  void DRV_USART_BufferEventHandlerSet
16257  (
16258  const DRV_HANDLE handle,
16259  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16260  const uintptr_t context
16261  )
16262  Summary:
16263  Allows a client to identify a buffer event handling function for the driver
16264  to call back when queued buffer transfers have finished.
16265  <p><b>Implementation:</b> Static/Dynamic</p>
16266  Description:
16267  This function allows a client to identify a buffer event handling function
16268  for the driver to call back when queued buffer transfers have finished.
16269  When a client calls either the DRV_USART_BufferAddRead or
16270  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16271  the buffer that was added to the driver's buffer queue. The driver will
16272  pass this handle back to the client by calling "eventHandler" function when
16273  the buffer transfer has completed.
16274  The event handler should be set before the client performs any "buffer add"
16275  operations that could generate events. The event handler once set, persists
16276  until the client closes the driver or sets another event handler (which
16277  could be a "NULL" pointer to indicate no callback).
16278  Precondition:
16279  The DRV_USART_Initialize routine must have been called for the specified
16280  USART driver instance.
16281  DRV_USART_Open must have been called to obtain a valid opened device handle.
16282  Parameters:
16283  handle - A valid open-instance handle, returned from the driver's
16284  open routine
16285  eventHandler - Pointer to the event handler function.
16286  context - The value of parameter will be passed back to the client
16287  unchanged, when the eventHandler function is called. It can
16288  be used to identify any client specific data object that
16289  identifies the instance of the client module (for example,
16290  it may be a pointer to the client module's state structure).
16291  Returns:
16292  None.
16293  Example:
16294  <code>
16295  // myAppObj is an application specific state data object.
16296  MY_APP_OBJ myAppObj;
16297  uint8_t mybuffer[MY_BUFFER_SIZE];
16298  DRV_USART_BUFFER_HANDLE bufferHandle;
16299  // myUSARTHandle is the handle returned
16300  // by the DRV_USART_Open function.
16301  // Client registers an event handler with driver. This is done once
16302  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16303  (uintptr_t)&myAppObj );
16304  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16305  myBuffer, MY_BUFFER_SIZE);
16306  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16307  {
16308  // Error handling here
16309  }
16310  // Event Processing Technique. Event is received when
16311  // the buffer is processed.
16312  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16313  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16314  {
16315  // The context handle was set to an application specific
16316  // object. It is now retrievable easily in the event handler.
16317  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16318  switch(event)
16319  {
16320  case DRV_USART_BUFFER_EVENT_COMPLETE:
16321  // This means the data was transferred.
16322  break;
16323  case DRV_USART_BUFFER_EVENT_ERROR:
16324  // Error handling here.
16325  break;
16326  default:
16327  break;
16328  }
16329  }
16330  </code>
16331  Remarks:
16332  If the client does not want to be notified when the queued buffer transfer
16333  has completed, it does not need to register a callback. This function is
16334  thread safe when called in a RTOS application.
16335 */
16336 
16337 void
16339  const DRV_HANDLE handle ,
16340  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16341  const uintptr_t context ) ;
16342 // *****************************************************************************
16343 /* Function:
16344  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16345  Summary:
16346  Removes a requested buffer from the queue.
16347  <p><b>Implementation:</b> Static/Dynamic</p>
16348  Description:
16349  This function removes a specified buffer from the queue.
16350  The client can use this function to delete
16351  1. An unwated stalled buffer.
16352  2. Queued buffers on timeout.
16353  or in any other use case.
16354  Precondition:
16355  The DRV_USART_Initialize routine must have been called for the specified
16356  USART driver instance.
16357  DRV_USART_Open must have been called to obtain a valid opened device handle.
16358  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16359  must have been called and a valid buffer handle returned.
16360  Parameters:
16361  bufferhandle - Handle of the buffer to delete.
16362  Returns:
16363  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16364  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16365  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16366  queue successfully.
16367  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16368  the queue because of mutex timeout in RTOS environment.
16369  Example:
16370  <code>
16371  // myAppObj is an application specific object.
16372  MY_APP_OBJ myAppObj;
16373  uint8_t mybuffer[MY_BUFFER_SIZE];
16374  DRV_USART_BUFFER_HANDLE bufferHandle;
16375  // myUSARTHandle is the handle returned
16376  // by the DRV_USART_Open function.
16377  // Client registers an event handler with driver. This is done once
16378  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16379  (uintptr_t)&myAppObj );
16380  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16381  myBuffer, MY_BUFFER_SIZE );
16382  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16383  {
16384  // Error handling here
16385  }
16386  // Event Processing Technique. Event is received when
16387  // the buffer is processed.
16388  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16389  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16390  {
16391  switch(event)
16392  {
16393  case DRV_USART_BUFFER_EVENT_COMPLETE:
16394  // This means the data was transferred.
16395  break;
16396  case DRV_USART_BUFFER_EVENT_ERROR:
16397  // Error handling here.
16398  break;
16399  default:
16400  break;
16401  }
16402  }
16403  // Timeout function, where remove queued buffer if it still exists.
16404  void APP_TimeOut(void)
16405  {
16406  DRV_USART_BUFFER_RESULT bufferResult;
16407  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16408  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16409  {
16410  //Buffer removed succesfully from the queue
16411  }
16412  else
16413  {
16414  //Either buffer is invalid or expired.
16415  //Or not able to acquire mutex in RTOS mode.
16416  }
16417  }
16418  </code>
16419  Remarks:
16420  This function is thread safe when used in a RTOS application.
16421 */
16422 
16425  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16426 // *****************************************************************************
16427 /* Function:
16428  size_t DRV_USART_BufferCompletedBytesGet
16429  (
16430  DRV_USART_BUFFER_HANDLE bufferHandle
16431  );
16432  Summary:
16433  Returns the number of bytes that have been processed for the
16434  specified buffer.
16435  <p><b>Implementation:</b> Static/Dynamic</p>
16436  Description:
16437  This function returns number of bytes that have been processed for the
16438  specified buffer. The client can use this function, in a case where the
16439  buffer has terminated due to an error, to obtain the number of bytes that
16440  have been processed. Or in any other use case.
16441  This function can be used for non-DMA buffer transfers only. It cannot be
16442  used when the USART driver is configured to use DMA.
16443  Precondition:
16444  The DRV_USART_Initialize routine must have been called for the specified
16445  USART driver instance.
16446  DRV_USART_Open must have been called to obtain a valid opened device handle.
16447  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16448  must have been called and a valid buffer handle returned.
16449  Parameters:
16450  bufferhandle - Handle for the buffer of which the processed number of bytes
16451  to be obtained.
16452  Returns:
16453  Returns the number of bytes that have been processed for this buffer.
16454  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16455  buffer handle.
16456  Example:
16457  <code>
16458  // myAppObj is an application specific object.
16459  MY_APP_OBJ myAppObj;
16460  uint8_t mybuffer[MY_BUFFER_SIZE];
16461  DRV_USART_BUFFER_HANDLE bufferHandle;
16462  // myUSARTHandle is the handle returned
16463  // by the DRV_USART_Open function.
16464  // Client registers an event handler with driver. This is done once
16465  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16466  (uintptr_t)&myAppObj );
16467  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16468  myBuffer, MY_BUFFER_SIZE );
16469  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16470  {
16471  // Error handling here
16472  }
16473  // Event Processing Technique. Event is received when
16474  // the buffer is processed.
16475  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16476  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16477  {
16478  // The context handle was set to an application specific
16479  // object. It is now retrievable easily in the event handler.
16480  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16481  size_t processedBytes;
16482  switch(event)
16483  {
16484  case DRV_USART_BUFFER_EVENT_COMPLETE:
16485  // This means the data was transferred.
16486  break;
16487  case DRV_USART_BUFFER_EVENT_ERROR:
16488  // Error handling here.
16489  // We can find out how many bytes were processed in this
16490  // buffer before the error occurred.
16491  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16492  break;
16493  default:
16494  break;
16495  }
16496  }
16497  </code>
16498  Remarks:
16499  This function is thread safe when used in a RTOS application.
16500 */
16501 
16502 size_t
16504  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16505 // *****************************************************************************
16506 /* Function:
16507  size_t DRV_USART_BufferProcessedSizeGet
16508  (
16509  DRV_USART_BUFFER_HANDLE bufferHandle
16510  );
16511  Summary:
16512  This API will be deprecated and not recommended to use.
16513  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16514  processed for the specified buffer.
16515  Description:
16516  None.
16517  Precondition:
16518  None.
16519  Parameters:
16520  None.
16521  Returns:
16522  None.
16523  Example:
16524  None.
16525  Remarks:
16526  None.
16527 */
16528 
16529 size_t
16531  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16532 // *****************************************************************************
16533 // *****************************************************************************
16534 // Section: USART Driver File System Model Routines
16535 // *****************************************************************************
16536 // *****************************************************************************
16537 // *****************************************************************************
16538 /* Function:
16539  size_t DRV_USART_Read
16540  (
16541  const DRV_HANDLE handle,
16542  void * buffer,
16543  const size_t numbytes
16544  )
16545  Summary:
16546  Reads data from the USART.
16547  <p><b>Implementation:</b> Static/Dynamic</p>
16548  Description:
16549  This routine reads data from the USART. This function is blocking if the
16550  driver was opened by the client for blocking operation. This function will
16551  not block if the driver was opened by the client for non blocking operation.
16552  If the ioIntent parameter at the time of opening the driver was
16553  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16554  until) numbytes of bytes have been received or if an error occurred. If there
16555  are buffers queued for receiving data, these buffers will be serviced first. The
16556  function will not return until the requested number of bytes have been read.
16557  If the ioIntent parameter at the time of opening the driver was
16558  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16559  bytes that were actually read. The function will not wait until numBytes of
16560  bytes have been read. If there are buffer queued for reading data, then the
16561  function will not block and will return immediately with 0 bytes read.
16562  Precondition:
16563  The DRV_USART_Initialize routine must have been called for the specified
16564  USART driver instance.
16565  DRV_USART_Open must have been called to obtain a valid opened device handle.
16566  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16567  the DRV_USART_Open call.
16568  Parameters:
16569  handle - A valid open-instance handle, returned from the driver's
16570  open routine
16571  buffer - Buffer into which the data read from the USART instance
16572  will be placed.
16573  numbytes - Total number of bytes that need to be read from the module
16574  instance (must be equal to or less than the size of the
16575  buffer)
16576  Returns:
16577  Number of bytes actually copied into the caller's buffer. Returns
16578  DRV_USART_READ_ERROR in case of an error.
16579  Example:
16580  <code>
16581  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16582  char myBuffer[MY_BUFFER_SIZE];
16583  unsigned int count;
16584  unsigned int total;
16585  total = 0;
16586  do
16587  {
16588  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16589  if(count == DRV_USART_READ_ERROR)
16590  {
16591  // There was an error. The DRV_USART_ErrorGet() function
16592  // can be called to find the exact error.
16593  }
16594  total += count;
16595  // Do something else...
16596  } while( total < MY_BUFFER_SIZE );
16597  </code>
16598  Remarks:
16599  This function is thread safe in a RTOS application. If the driver is
16600  configured for polled operation, this it will not support blocking operation
16601  in a bare metal (non-RTOS) application.
16602 */
16603 
16604 size_t
16605  DRV_USART_Read (
16606  const DRV_HANDLE handle ,
16607  void * buffer ,
16608  const size_t numbytes ) ;
16609 // *****************************************************************************
16610 /* Function:
16611  size_t DRV_USART_Write
16612  (
16613  const DRV_HANDLE handle,
16614  void * buffer,
16615  const size_t numbytes
16616  )
16617  Summary:
16618  Writes data to the USART.
16619  <p><b>Implementation:</b> Static/Dynamic</p>
16620  Description:
16621  This routine writes data to the USART. This function is blocking if the
16622  driver was opened by the client for blocking operation. This function will
16623  not block if the driver was opened by the client for non blocking operation.
16624  If the ioIntent parameter at the time of opening the driver was
16625  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16626  until) numbytes of bytes have been transmitted or if an error occurred. If
16627  there are buffers queued for writing, the function will wait until all the
16628  preceding buffers are completed. Ongoing buffer transmit operations will not
16629  be affected.
16630  If the ioIntent parameter at the time of opening the driver was
16631  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16632  bytes that were actually accepted for transmission. The function will not
16633  wait until numBytes of bytes have been transmitted. If there a buffers queued
16634  for transmit, the function will not wait and will return immediately with 0
16635  bytes.
16636  Precondition:
16637  The DRV_USART_Initialize routine must have been called for the specified
16638  USART driver instance.
16639  DRV_USART_Open must have been called to obtain a valid opened device handle.
16640  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16641  the DRV_USART_Open call.
16642  Parameters:
16643  handle - A valid open-instance handle, returned from the driver's
16644  open routine
16645  buffer - Buffer containing the data to written.
16646  numbytes - size of the buffer
16647  Returns:
16648  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16649  in case of an error.
16650  Example:
16651  <code>
16652  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16653  char myBuffer[MY_BUFFER_SIZE];
16654  int count;
16655  unsigned int total;
16656  total = 0;
16657  do
16658  {
16659  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16660  MY_BUFFER_SIZE - total);
16661  total += count;
16662  // Do something else...
16663  } while( total < MY_BUFFER_SIZE );
16664  </code>
16665  Remarks:
16666  This function is thread safe in a RTOS application. This function is thread
16667  safe in a RTOS application. If the driver is configured for polled
16668  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16669  application.
16670 */
16671 
16672 size_t
16673  DRV_USART_Write (
16674  const DRV_HANDLE handle ,
16675  void * buffer ,
16676  const size_t numbytes ) ;
16677 // *****************************************************************************
16678 /* Function:
16679  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16680  Summary:
16681  Returns the transmitter and receiver transfer status.
16682  <p><b>Implementation:</b> Static/Dynamic</p>
16683  Description:
16684  This returns the transmitter and receiver transfer status.
16685  Precondition:
16686  The DRV_USART_Initialize routine must have been called for the specified
16687  USART driver instance.
16688  DRV_USART_Open must have been called to obtain a valid opened device handle.
16689  Parameters:
16690  handle - A valid open-instance handle, returned from the driver's
16691  open routine
16692  Returns:
16693  A DRV_USART_TRANSFER_STATUS value describing the current status
16694  of the transfer.
16695  Example:
16696  <code>
16697  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16698  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16699  {
16700  // Data has been received that can be read
16701  }
16702  </code>
16703  Remarks:
16704  The returned status may contain a value with more than one of the bits
16705  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16706  should perform an "AND" with the bit of interest and verify if the result is
16707  non-zero (as shown in the example) to verify the desired status bit. This
16708  function is thread safe when called in a RTOS application.
16709 */
16710 
16713  const DRV_HANDLE handle ) ;
16714 // *****************************************************************************
16715 // *****************************************************************************
16716 // Section: USART Driver Byte Model Routines
16717 // *****************************************************************************
16718 // *****************************************************************************
16719 // *****************************************************************************
16720 /* Function:
16721  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16722  Summary:
16723  Reads a byte of data from the USART.
16724  <p><b>Implementation:</b> Static/Dynamic</p>
16725  Description:
16726  This routine reads a byte of data from the USART.
16727  Precondition:
16728  The DRV_USART_Initialize routine must have been called for the specified
16729  USART driver instance.
16730  DRV_USART_Open must have been called to obtain a valid opened device handle.
16731  The transfer status should be checked to see if the receiver is not empty
16732  before calling this function.
16733  Parameters:
16734  handle - A valid open-instance handle, returned from the driver's
16735  open routine
16736  Returns:
16737  A data byte received by the driver.
16738  Example:
16739  <code>
16740  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16741  char myBuffer[MY_BUFFER_SIZE];
16742  unsigned int numBytes;
16743  numBytes = 0;
16744  do
16745  {
16746  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16747  {
16748  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16749  }
16750  // Do something else...
16751  } while( numBytes < MY_BUFFER_SIZE);
16752  </code>
16753  Remarks:
16754  This function is thread safe when called in a RTOS application. Note that
16755  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16756  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16757  DRV_USART_Write functions in a application. Calling the
16758  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16759  processing of any queued buffers.
16760 */
16761 
16762 uint8_t
16764  const DRV_HANDLE handle ) ;
16765 // *****************************************************************************
16766 /* Function:
16767  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16768  Summary:
16769  Writes a byte of data to the USART.
16770  <p><b>Implementation:</b> Static/Dynamic</p>
16771  Description:
16772  This routine writes a byte of data to the USART.
16773  Precondition:
16774  The DRV_USART_Initialize routine must have been called for the specified
16775  USART driver instance.
16776  DRV_USART_Open must have been called to obtain a valid opened device handle.
16777  The transfer status should be checked to see if transmitter is not full
16778  before calling this function.
16779  Parameters:
16780  handle - A valid open-instance handle, returned from the driver's
16781  open routine
16782  byte - Data byte to write to the USART
16783  Returns:
16784  None.
16785  Example:
16786  <code>
16787  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16788  char myBuffer[MY_BUFFER_SIZE];
16789  unsigned int numBytes;
16790  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16791  numBytes = 0;
16792  while( numBytes < MY_BUFFER_SIZE );
16793  {
16794  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16795  {
16796  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16797  }
16798  // Do something else...
16799  }
16800  </code>
16801  Remarks:
16802  This function is thread safe when called in a RTOS application. Note that
16803  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16804  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16805  DRV_USART_Write functions in a application. Calling the
16806  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16807  processing of any queued buffers.
16808 */
16809 
16810 void
16812  const DRV_HANDLE handle ,
16813  const uint8_t byte ) ;
16814 // *****************************************************************************
16815 /* Function:
16816  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16817  Summary:
16818  Returns the size of the receive buffer.
16819  <p><b>Implementation:</b> Static/Dynamic</p>
16820  Description:
16821  This routine returns the size of the receive buffer.
16822  Precondition:
16823  The DRV_USART_Initialize routine must have been called for the specified
16824  USART driver instance.
16825  DRV_USART_Open must have been called to obtain a valid opened device handle.
16826  Parameters:
16827  handle - A valid open-instance handle, returned from the driver's
16828  open routine
16829  Returns:
16830  Size of the driver's receive buffer, in bytes.
16831  Example:
16832  <code>
16833  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16834  const uint8_t readBuffer[5];
16835  unsigned int size, numBytes = 0;
16836  unsigned int readbufferLen = sizeof(readBuffer);
16837  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16838  // Do something based on the receiver buffer size
16839  </code>
16840  Remarks:
16841  Does not account for client queued buffers. This function is thread safe
16842  when called in a RTOS application.
16843 */
16844 
16845 unsigned int
16847  const DRV_HANDLE handle ) ;
16848 // *****************************************************************************
16849 /* Function:
16850  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16851  Summary:
16852  Returns the size of the transmit buffer.
16853  <p><b>Implementation:</b> Static/Dynamic</p>
16854  Description:
16855  This routine returns the size of the transmit buffer and can be used by the
16856  application to determine the number of bytes to write with the
16857  DRV_USART_WriteByte function.
16858  Precondition:
16859  The DRV_USART_Initialize routine must have been called for the specified
16860  USART driver instance.
16861  DRV_USART_Open must have been called to obtain a valid opened device handle.
16862  Parameters:
16863  handle - A valid open-instance handle, returned from the driver's
16864  open routine
16865  Returns:
16866  Size of the driver's transmit buffer, in bytes.
16867  Examples:
16868  <code>
16869  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16870  const uint8_t writeBuffer[5];
16871  unsigned int size, numBytes = 0;
16872  unsigned int writeBufferLen = sizeof(writeBuffer);
16873  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16874  // Do something based on the transmitter buffer size
16875  </code>
16876  Remarks:
16877  Does not account for client queued buffers. This function is thread safe
16878  when used in a RTOS application.
16879 */
16880 
16881 unsigned int
16883  const DRV_HANDLE handle ) ;
16884 // *****************************************************************************
16885 /* Function:
16886  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16887  Summary:
16888  Provides the status of the driver's receive buffer.
16889  <p><b>Implementation:</b> Static/Dynamic</p>
16890  Description:
16891  This routine indicates if the driver's receiver buffer is empty. This
16892  function can be used in conjunction with the DRV_USART_Read and
16893  DRV_USART_ReadByte functions.
16894  Precondition:
16895  The DRV_USART_Initialize routine must have been called for the specified
16896  USART driver instance.
16897  DRV_USART_Open must have been called to obtain a valid opened device handle.
16898  Parameters:
16899  handle - A valid open-instance handle, returned from the driver's
16900  open routine
16901  Returns:
16902  true - if the driver's receive buffer is empty
16903  false - if the driver's receive buffer is not empty
16904  Example:
16905  <code>
16906  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16907  char myBuffer[MY_BUFFER_SIZE];
16908  unsigned int numBytes;
16909  numBytes = 0;
16910  while( numBytes < MY_BUFFER_SIZE );
16911  {
16912  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16913  {
16914  if( numBytes < MY_BUFFER_SIZE )
16915  {
16916  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16917  }
16918  else
16919  {
16920  break;
16921  }
16922  }
16923  // Do something else while more data is received.
16924  }
16925  </code>
16926  Remarks:
16927  Does not account for client queued buffers. This function is safe thread
16928  safe when used in a RTOS application.
16929 */
16930 
16931 bool
16933  const DRV_HANDLE handle ) ;
16934 // *****************************************************************************
16935 /* Function:
16936  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16937  Summary:
16938  Provides the status of the driver's transmit buffer.
16939  <p><b>Implementation:</b> Static/Dynamic</p>
16940  Description:
16941  This routine identifies if the driver's transmit buffer is full or not. This
16942  function can be used in conjunction with the DRV_USART_Write and
16943  DRV_USART_WriteByte functions.
16944  Precondition:
16945  The DRV_USART_Initialize routine must have been called for the specified
16946  USART driver instance.
16947  DRV_USART_Open must have been called to obtain a valid opened device handle.
16948  Parameters:
16949  handle - A valid open-instance handle, returned from the driver's
16950  open routine
16951  Returns:
16952  true - if the transmit buffer is full
16953  false - if the transmit buffer is not full
16954  Example:
16955  <code>
16956  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16957  unsigned int numBytes;
16958  int bytesToWrite;
16959  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16960  int writebufferLen = strlen((char *)writeBuffer);
16961  numBytes = 0;
16962  while( numBytes < writebufferLen )
16963  {
16964  if (DRV_USART_TransmitBufferisFull())
16965  {
16966  // Do something else until there is some room in the driver's Transmit buffer.
16967  }
16968  else
16969  {
16970  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16971  }
16972  }
16973  </code>
16974  Remarks:
16975  Does not account for client queued buffers. This function is thread safe
16976  when called in a RTOS application.
16977 */
16978 
16979 bool
16981  const DRV_HANDLE handle ) ;
16982 // *****************************************************************************
16983 /* Function:
16984  void DRV_USART_ByteTransmitCallbackSet
16985  (
16986  const SYS_MODULE_INDEX index,
16987  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16988  )
16989  Summary:
16990  Registers a callback function for byte transmit event.
16991  Description:
16992  This function allows a transmit callback function to be registered with the
16993  driver. The callback function is invoked when a byte has been transmitted
16994  using DRV_USART_WriteByte () function.
16995  The callback function should be registered with the driver prior to any
16996  writes to the driver. The callback functionality is available only in the
16997  interrupt mode of operation. The driver clears the interrupt after invoking
16998  the callback function.
16999  Precondition:
17000  The DRV_USART_Initialize routine must have been called for the specified
17001  USART driver instance.
17002  Parameters:
17003  index - Identifier for the object instance to be opened
17004  eventHandler - Pointer to the event handler function.
17005  Returns:
17006  None.
17007  Example:
17008  <code>
17009  // myAppObj is an application specific state data object.
17010  MY_APP_OBJ myAppObj;
17011  uint8_t mybuffer[MY_BUFFER_SIZE];
17012  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17013  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17014  (uintptr_t)&myAppObj );
17015  // Register an event handler with driver. This is done once
17016  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17017  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17018  // Event Processing Technique. Event is received when
17019  // the byte is transmitted.
17020  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17021  {
17022  // Byte has been transmitted. Handle the event.
17023  }
17024  </code>
17025  Remarks:
17026  None
17027 */
17028 
17029 void
17031  const SYS_MODULE_INDEX index ,
17032  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17033 // *****************************************************************************
17034 /* Function:
17035  void DRV_USART_ByteReceiveCallbackSet
17036  (
17037  const SYS_MODULE_INDEX index,
17038  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17039  )
17040  Summary:
17041  Registers receive callback function for byte receive event.
17042  Description:
17043  This function allows a receive callback function to be registered with the
17044  driver. The callback function is invoked when a byte has been received. The
17045  received byte can then be read using DRV_USART_ReadByte() function.
17046  The callback function should be registered with the driver as part of the
17047  initialization. The callback functionality is available only in the
17048  interrupt mode of operation. The driver clears the interrupt after invoking
17049  the callback function.
17050  Precondition:
17051  The DRV_USART_Initialize routine must have been called for the specified
17052  USART driver instance.
17053  Parameters:
17054  index - Identifier for the object instance to be opened
17055  eventHandler - Pointer to the event handler function.
17056  Returns:
17057  None.
17058  Example:
17059  <code>
17060  // myAppObj is an application specific state data object.
17061  MY_APP_OBJ myAppObj;
17062  uint8_t mybuffer[MY_BUFFER_SIZE];
17063  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17064  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17065  (uintptr_t)&myAppObj );
17066  // Register an event handler with driver. This is done once
17067  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17068  // Event Processing Technique. Event is received when
17069  // a byte is received.
17070  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17071  {
17072  // Byte has been Received. Handle the event.
17073  // Read byte using DRV_USART_ReadByte ()
17074  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17075  // check if the receiver buffer is empty.
17076  }
17077  </code>
17078  Remarks:
17079  None
17080 */
17081 
17082 void
17084  const SYS_MODULE_INDEX index ,
17085  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17086 // *****************************************************************************
17087 /* Function:
17088  void DRV_USART_ByteErrorCallbackSet
17089  (
17090  const SYS_MODULE_INDEX index,
17091  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17092  )
17093  Summary:
17094  Registers callback to handle for byte error events.
17095  Description:
17096  This function allows a callback function to be registered with the driver
17097  to handle the error events occurring in the transmit/receive path during
17098  byte transfers.
17099  The callback function should be registered as part of the initialization.
17100  The callback functionality is available only in the interrupt mode of
17101  operation. The driver clears the interrupt after invoking the callback
17102  function.
17103  Precondition:
17104  The DRV_USART_Initialize routine must have been called for the specified
17105  USART driver instance.
17106  Parameters:
17107  index - Identifier for the object instance to be opened
17108  eventHandler - Pointer to the event handler function.
17109  Returns:
17110  None.
17111  Example:
17112  <code>
17113  // myAppObj is an application specific state data object.
17114  MY_APP_OBJ myAppObj;
17115  uint8_t mybuffer[MY_BUFFER_SIZE];
17116  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17117  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17118  (uintptr_t)&myAppObj );
17119  // Register an event handler with driver. This is done once
17120  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17121  // Event Processing Technique.
17122  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17123  {
17124  // Error has occurred. Handle the event.
17125  }
17126  </code>
17127  Remarks:
17128  None
17129 */
17130 
17131 void
17133  const SYS_MODULE_INDEX index ,
17134  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17135 // *****************************************************************************
17136 // *****************************************************************************
17137 // Section: USART Driver Setup and Status Routines
17138 // *****************************************************************************
17139 // *****************************************************************************
17140 // *****************************************************************************
17141 /* Function:
17142  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17143  Summary:
17144  This function returns the error(if any) associated with the last client
17145  request.
17146  <p><b>Implementation:</b> Static/Dynamic</p>
17147  Description:
17148  This function returns the error(if any) associated with the last client
17149  request. DRV_USART_Read and DRV_USART_Write will update the client
17150  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17151  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17152  call this function to know the error cause. The error status will be updated
17153  on every operation and should be read frequently (ideally immediately after
17154  the driver operation has completed) to know the relevant error status.
17155  Precondition:
17156  The DRV_USART_Initialize routine must have been called for the specified
17157  USART driver instance.
17158  DRV_USART_Open must have been called to obtain a valid opened device handle.
17159  Parameters:
17160  bufferhandle - Handle of the buffer of which the processed number of bytes
17161  to be obtained.
17162  Returns:
17163  A DRV_USART_ERROR type indicating last known error status.
17164  Example:
17165  <code>
17166  // myAppObj is an application specific object.
17167  MY_APP_OBJ myAppObj;
17168  uint8_t mybuffer[MY_BUFFER_SIZE];
17169  DRV_USART_BUFFER_HANDLE bufferHandle;
17170  // myUSARTHandle is the handle returned
17171  // by the DRV_USART_Open function.
17172  // Client registers an event handler with driver. This is done once.
17173  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17174  (uintptr_t)&myAppObj );
17175  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17176  myBuffer, MY_BUFFER_SIZE );
17177  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17178  {
17179  // Error handling here
17180  }
17181  // Event Processing Technique. Event is received when
17182  // the buffer is processed.
17183  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17184  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17185  {
17186  // The context handle was set to an application specific
17187  // object. It is now retrievable easily in the event handler.
17188  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17189  size_t processedBytes;
17190  switch(event)
17191  {
17192  case DRV_USART_BUFFER_EVENT_COMPLETE:
17193  // This means the data was transferred.
17194  break;
17195  case DRV_USART_BUFFER_EVENT_ERROR:
17196  // Error handling here.
17197  // We can find out how many bytes were processed in this
17198  // buffer before the error occurred. We can also find
17199  // the error cause.
17200  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17201  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17202  {
17203  // There was an receive over flow error.
17204  // Do error handling here.
17205  }
17206  break;
17207  default:
17208  break;
17209  }
17210  }
17211  </code>
17212  Remarks:
17213  It is the client's responsibility to make sure that the error status is
17214  obtained frequently. The driver will update the client error status
17215  regardless of whether this has been examined by the client. This function
17216  is thread safe when used in a RTOS application.
17217 */
17218 
17221  const DRV_HANDLE client ) ;
17222 // *****************************************************************************
17223 /* Function:
17224  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17225  Summary:
17226  This function changes the USART module baud to the specified value.
17227  <p><b>Implementation:</b> Static/Dynamic</p>
17228  Description:
17229  This function changes the USART module baud to the specified value. Any
17230  queued buffer requests will be processed at the updated baud. The USART
17231  driver operates at the baud specified in DRV_USART_Initialize function
17232  unless the DRV_USART_BaudSet function is called to change the baud.
17233  Precondition:
17234  The DRV_USART_Initialize routine must have been called for the specified
17235  USART driver instance.
17236  DRV_USART_Open must have been called to obtain a valid opened device handle.
17237  Parameters:
17238  handle - client handle returned by DRV_USART_Open function.
17239  baud - desired baud.
17240  Returns:
17241  None.
17242  Example:
17243  <code>
17244  // myUSARTHandle is the handle returned
17245  // by the DRV_USART_Open function.
17246  DRV_USART_BaudSet(myUSARTHandle, 9600);
17247  </code>
17248  Remarks:
17249  The implementation of this function, in this release of the driver, changes
17250  the baud immediately. This may interrupt on-going data transfer. It is
17251  recommended that the driver be opened exclusively if this function is to be
17252  called. This function is thread safe when used in a RTOS application.
17253 */
17254 
17257  const DRV_HANDLE client ,
17258  uint32_t baud ) ;
17259 // *****************************************************************************
17260 /* Function:
17261  void DRV_USART_LineControlSet
17262  (
17263  DRV_HANDLE client,
17264  DRV_USART_LINE_CONTROL lineControl
17265  );
17266  Summary:
17267  This function changes the USART module line control to the specified value.
17268  <p><b>Implementation:</b> Static/Dynamic</p>
17269  Description:
17270  This function changes the USART module line control parameters to the
17271  specified value. Any queued buffer requests will be processed at the
17272  updated line control parameters. The USART driver operates at the line
17273  control parameters specified in DRV_USART_Initialize function unless the
17274  DRV_USART_LineControlSet function is called to change the line control
17275  parameters.
17276  Precondition:
17277  The DRV_USART_Initialize routine must have been called for the specified
17278  USART driver instance.
17279  DRV_USART_Open must have been called to obtain a valid opened device handle.
17280  Parameters:
17281  handle - client handle returned by DRV_USART_Open function.
17282  lineControl - line control parameters.
17283  Returns:
17284  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17285  DRV_HANDLE_INVALID if the client handle is not valid.
17286  Example:
17287  <code>
17288  // myUSARTHandle is the handle returned
17289  // by the DRV_USART_Open function.
17290  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17291  </code>
17292  Remarks:
17293  The implementation of this function, in this release of the driver, changes
17294  the line control immediately. This may interrupt on-going data transfer. It
17295  is recommended that the driver be opened exclusively if this function is to
17296  be called. This function is thread safe when called in a RTOS application.
17297 */
17298 
17301  const DRV_HANDLE client ,
17302  const DRV_USART_LINE_CONTROL lineControl ) ;
17303 //DOM-IGNORE-BEGIN
17304 //DOM-IGNORE-END
17305  // #ifndef _DRV_USART_H
17306 /*******************************************************************************
17307  End of File
17308 */
17309 
17310 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17311 /* CLOSE_FILE Include File */
17312 
17313 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17314 /*******************************************************************************
17315  USART Driver Variant Mapping
17316  Company:
17317  Microchip Technology Inc.
17318  File Name:
17319  drv_usart_variant_mapping.h
17320  Summary:
17321  USART Driver Variant Mapping
17322  Description:
17323  This file provides feature and build variant mapping macros allowing the
17324  driver to easily be built with different implementation variations based
17325  on static build-time configuration selections.
17326 *******************************************************************************/
17327 //DOM-IGNORE-BEGIN
17328 /*******************************************************************************
17329 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17330 Microchip licenses to you the right to use, modify, copy and distribute
17331 Software only when embedded on a Microchip microcontroller or digital signal
17332 controller that is integrated into your product or third party product
17333 (pursuant to the sublicense terms in the accompanying license agreement).
17334 You should refer to the license agreement accompanying this Software for
17335 additional information regarding your rights and obligations.
17336 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17337 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17338 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17339 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17340 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17341 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17342 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17343 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17344 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17345 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17346 *******************************************************************************/
17347 //DOM-IGNORE-END
17348 #ifndef _DRV_USART_FEATURE_MAPPING_H
17349 #define _DRV_USART_FEATURE_MAPPING_H
17350 // *****************************************************************************
17351 // *****************************************************************************
17352 // Section: Interrrupt Variations
17353 // *****************************************************************************
17354 // *****************************************************************************
17355 /* Mapping of the interrupt mode variations
17356 */
17357  /* Driver is configured for polled mode */
17358 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17359 #define _DRV_USART_InterruptSourceEnable( source )
17360 #define _DRV_USART_InterruptSourceDisable( source ) false
17361 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17362 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17363 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17364 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17365 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17366  /* This means the driver is being built in a baremetal application.
17367  We cannot let a client open the driver in blocking mode */
17368 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17369 // *****************************************************************************
17370 // *****************************************************************************
17371 // Section: Buffer Queue support
17372 // *****************************************************************************
17373 // *****************************************************************************
17374 /* Mapping of macros for buffer queue support
17375 */
17376  /* We dont need buffer queues or byte model support */
17377 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17378 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17379 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17380 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17381 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17382 // *****************************************************************************
17383 // *****************************************************************************
17384 // Initializtion Parameter Static Overrides
17385 // *****************************************************************************
17386 // *****************************************************************************
17387  //_DRV_USART_FEATURE_MAPPING_H
17388 /*******************************************************************************
17389  End of File
17390 */
17391 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17392 /* CLOSE_FILE Include File */
17393 
17394 #include "system/clk/sys_clk.h"
17395 #include "system/int/sys_int.h"
17396 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17397 /*******************************************************************************
17398  Debug System Services Library Header
17399  Company:
17400  Microchip Technology Inc.
17401 
17402  File Name:
17403  sys_debug.h
17404  Summary:
17405  Defines the common debug definitions and interfaces used by MPLAB Harmony
17406  libraries to report errors and debug information to the user.
17407  Description:
17408  This header file defines the common debug definitions and interface macros
17409  (summary below) and prototypes used by MPLAB Harmony libraries to report
17410  errors and debug information to the user.
17411  *******************************************************************************/
17412 //DOM-IGNORE-BEGIN
17413 /*******************************************************************************
17414 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17415 Microchip licenses to you the right to use, modify, copy and distribute
17416 Software only when embedded on a Microchip microcontroller or digital signal
17417 controller that is integrated into your product or third party product
17418 (pursuant to the sublicense terms in the accompanying license agreement).
17419 You should refer to the license agreement accompanying this Software for
17420 additional information regarding your rights and obligations.
17421 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17422 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17423 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17424 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17425 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17426 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17427 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17428 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17429 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17430 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17431  *******************************************************************************/
17432 //DOM-IGNORE-END
17433 #ifndef _SYS_DEBUG_H
17434 #define _SYS_DEBUG_H
17435 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17436  /* LDRA full path */
17437 // This should be defined in system_config.h. It is added here as a build safe-guard.
17438 #define SYS_DEBUG_BUFFER_DMA_READY
17439 // *****************************************************************************
17440 // *****************************************************************************
17441 // Section: SYS DEBUG Data Types
17442 // *****************************************************************************
17443 // *****************************************************************************
17444 // *****************************************************************************
17445 /* SYS_ERROR_LEVEL enumeration
17446  Summary:
17447  System error message priority levels.
17448  Description:
17449  This enumeration defines the supported system error message priority values.
17450  Remarks:
17451  Used by debug message macros to compare individual message priority against
17452  a global system-wide error message priority level to determine if an
17453  individual message should be displayed.
17454 */
17455 
17456 typedef
17457  enum
17458  {
17459  /* Errors that have the potential to cause a system crash. */
17461  /* Errors that have the potential to cause incorrect behavior. */
17463  /* Warnings about potentially unexpected behavior or side effects. */
17465  /* Information helpful to understanding potential errors and warnings. */
17467  /* Verbose information helpful during debugging and testing. */
17469  } SYS_ERROR_LEVEL ;
17470 // DOM-IGNORE-BEGIN
17471 // *****************************************************************************
17472 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17473  SYS_DEBUG_ErrorLevelSet functions to access this value.
17474 */
17475 
17476 extern SYS_ERROR_LEVEL
17477  gblErrLvl ;
17478 // DOM-IGNORE-END
17479 // *****************************************************************************
17480 /* SYS Debug Module Index Number
17481  Summary:
17482  Debug System Service index.
17483  Description:
17484  This constant defines a symbolic name for the debug system service index.
17485  Remarks:
17486  There can only be a single debug system service instance in the system.
17487 */
17488 #define SYS_DEBUG_INDEX_0 0
17489 // *****************************************************************************
17490 /* SYS Debug Initialize structure
17491  Summary:
17492  Defines the data required to initialize the debug system service.
17493  Description:
17494  This structure defines the data required to initialize the debug system
17495  service.
17496  Remarks:
17497  None.
17498 */
17499 
17500 typedef
17501  struct
17502  {
17503  /* System module initialization */
17504  SYS_MODULE_INIT moduleInit ;
17505  /* Initial system error level setting. */
17506  SYS_ERROR_LEVEL errorLevel ;
17507  /* Console index to receive debug messages */
17508  SYS_MODULE_INDEX consoleIndex ;
17509  } SYS_DEBUG_INIT ;
17510 // *****************************************************************************
17511 // *****************************************************************************
17512 // Section: SYS DEBUG Functions
17513 // *****************************************************************************
17514 // *****************************************************************************
17515 // *****************************************************************************
17516 /* Function:
17517  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17518  const SYS_MODULE_INIT * const init )
17519  Summary:
17520  Initializes the global error level and specific module instance.
17521  Description:
17522  This function initializes the global error level. It also initializes any
17523  internal system debug module data structures.
17524  Precondition:
17525  None.
17526  Parameters:
17527  index - Index for the instance to be initialized
17528  init - Pointer to a data structure containing any data necessary
17529  to initialize the debug service. This pointer may be null
17530  if no data is required because static overrides have
17531  been provided.
17532  Returns:
17533  If successful, returns a valid handle to an object. Otherwise, it
17534  returns SYS_MODULE_OBJ_INVALID.
17535  Example:
17536  <code>
17537  SYS_MODULE_OBJ objectHandle;
17538  SYS_DEBUG_INIT debugInit =
17539  {
17540  .moduleInit = {0},
17541  .errorLevel = SYS_ERROR_DEBUG,
17542  };
17543  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17544  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17545  {
17546  // Handle error
17547  }
17548  </code>
17549  Remarks:
17550  This routine should only be called once during system initialization. If the
17551  system was already initialized it safely returns without causing any disturbance.
17552 */
17553 
17554 SYS_MODULE_OBJ
17556  const SYS_MODULE_INDEX index ,
17557  const SYS_MODULE_INIT * const init ) ;
17558 // *****************************************************************************
17559 /* Function:
17560  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17561  const SYS_MODULE_INIT * const init )
17562  Summary:
17563  Reinitializes and refreshes the data structure for the instance of the
17564  Debug module.
17565  Description:
17566  This function reinitializes and refreshes the data structure for the instance
17567  of the Debug module using the supplied data.
17568  Precondition:
17569  The SYS_DEBUG_Initialize function should have been called before calling
17570  this function.
17571  Parameters:
17572  object - Identifies the SYS DEBUG Object returned by the Initialize
17573  interface
17574  init - Pointer to the data structure containing any data
17575  necessary to initialize the hardware
17576  Returns:
17577  None
17578  Example:
17579  <code>
17580  SYS_MODULE_OBJ objectHandle;
17581  // Populate the console initialization structure
17582  SYS_DEBUG_INIT dbgInit =
17583  {
17584  .moduleInit = {0},
17585  .errorLevel = SYS_ERROR_DEBUG,
17586  };
17587  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17588  </code>
17589  Remarks:
17590  This operation uses the same initialization data structure as the
17591  SYS_DEBUG_Initialize operation. This function can be called multiple times
17592  to reinitialize the module.
17593 */
17594 
17595 void
17597  SYS_MODULE_OBJ object ,
17598  const SYS_MODULE_INIT * const init ) ;
17599 // *****************************************************************************
17600 /* Function:
17601  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17602  Summary:
17603  Deinitializes the specific module instance of the Debug module.
17604  Description:
17605  This function deinitializes the specific module instance disabling its
17606  operation (and any hardware for driver modules). Resets all of the internal
17607  data structures and fields for the specified instance to the default settings.
17608  Precondition:
17609  The SYS_DEBUG_Initialize function should have been called before calling
17610  this function.
17611  Parameters:
17612  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17613  Returns:
17614  None.
17615  Example:
17616  <code>
17617  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17618  SYS_DEBUG_Deinitialize (object);
17619  </code>
17620  Remarks:
17621  Once the Initialize operation has been called, the Deinitialize
17622  operation must be called before the Initialize operation can be called
17623  again.
17624 */
17625 
17626 void
17628  SYS_MODULE_OBJ object ) ;
17629 // *****************************************************************************
17630 /* Function:
17631  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17632  Summary:
17633  Maintains the debug module's state machine.
17634  Description:
17635  This function is used to maintain the debug module's internal state
17636  machine and implement its ISR for interrupt-driven implementations.
17637  Precondition:
17638  The SYS_DEBUG_Initialize function must have been called for the specified
17639  CONSOLE driver instance.
17640  Parameters:
17641  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17642  Returns:
17643  None.
17644  Example:
17645  <code>
17646  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17647  while (true)
17648  {
17649  SYS_DEBUG_Tasks (object);
17650  // Do other tasks
17651  }
17652  </code>
17653  Remarks:
17654  This function is normally not called directly by an application. It is
17655  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17656  ISR.
17657 */
17658 
17659 void
17660  SYS_DEBUG_Tasks (
17661  SYS_MODULE_OBJ object ) ;
17662 // *****************************************************************************
17663 /* Function:
17664  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17665  Summary:
17666  Returns status of the specific instance of the debug service module.
17667  Description:
17668  This function returns the status of the specific debug service module
17669  instance.
17670  Precondition:
17671  The SYS_CONSOLE_Initialize function should have been called before calling
17672  this function.
17673  Parameters:
17674  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17675  Returns:
17676  * SYS_STATUS_READY - Indicates that the module is running and
17677  ready to service requests. Any value greater
17678  than SYS_STATUS_READY is also a normal
17679  running state in which the module is ready
17680  to accept new operations.
17681  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17682  previous system level operation and cannot
17683  start another.
17684  * SYS_STATUS_ERROR - Indicates that the module is in an error
17685  state. Any value less than SYS_STATUS_ERROR
17686  is also an error state.
17687  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17688  initialized or has been deinitialized.
17689  Example:
17690  <code>
17691  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17692  SYS_STATUS debugStatus;
17693  debugStatus = SYS_DEBUG_Status (object);
17694  if (SYS_STATUS_ERROR >= debugStatus)
17695  {
17696  // Handle error
17697  }
17698  </code>
17699  Remarks:
17700  None.
17701 */
17702 
17703 SYS_STATUS
17705  SYS_MODULE_OBJ object ) ;
17706 // *****************************************************************************
17707 // *****************************************************************************
17708 // Section: SYS DEBUG Console Functions
17709 // *****************************************************************************
17710 // *****************************************************************************
17711 // *****************************************************************************
17712 /* Function:
17713  SYS_DEBUG_Message( const char* message );
17714  Summary:
17715  Prints a message to the console regardless of the system error level.
17716  Description:
17717  This function prints a message to the console regardless of the system
17718  error level. It can be used as an implementation of the SYS_MESSAGE and
17719  SYS_DEBUG_MESSAGE macros.
17720  Precondition:
17721  SYS_DEBUG_Initialize must have returned a valid object handle and the
17722  SYS_DEBUG_Tasks function must be called by the system to complete the
17723  message request.
17724  Parameters:
17725  message - Pointer to a message string to be displayed.
17726  Returns:
17727  None.
17728  Example:
17729  <code>
17730  // In system_config.h:
17731 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17732 
17733  // In source (.c) files:
17734  SYS_MESSAGE("My Message\n\r");
17735  </code>
17736  Remarks:
17737  Do not call this function directly. Call the SYS_MESSAGE or
17738  SYS_DEBUG_MESSAGE macros instead.
17739 
17740  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17741  the messages and message function calls from the source code. To access
17742  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17743  override the definitions of the individual macros.
17744 */
17745 
17746 void
17748  const char * message ) ;
17749 // *****************************************************************************
17750 /* Function:
17751  SYS_DEBUG_Print( const char* format, ... )
17752  Summary:
17753  Formats and prints a message with a variable number of arguments to the
17754  console regardless of the system error level.
17755  Description:
17756  This function formats and prints a message with a variable number of
17757  arguments to the console regardless of the system error level. It can be
17758  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17759  Precondition:
17760  SYS_DEBUG_Initialize must have returned a valid object handle and the
17761  SYS_DEBUG_Tasks function must be called by the system to complete the
17762  message request.
17763  Parameters:
17764  format - Pointer to a buffer containing the format string for
17765  the message to be displayed.
17766  ... - Zero or more optional parameters to be formated as
17767  defined by the format string.
17768  Returns:
17769  None.
17770  Example:
17771  <code>
17772  // In system_config.h
17773 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17774 
17775  // In source code
17776  int result;
17777 
17778  result = SomeOperation();
17779  if (result > MAX_VALUE)
17780  {
17781  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17782  }
17783  </code>
17784  Remarks:
17785  The format string and arguments follow the printf convention.
17786 
17787  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17788  macros instead.
17789 
17790  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17791  messages and message function calls. To access and utilize the messages,
17792  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17793  individual macros.
17794 */
17795 
17796 void
17797  SYS_DEBUG_Print (
17798  const char * format ,
17799  ... ) ;
17800 // *****************************************************************************
17801 /* Function:
17802  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17803  Summary:
17804  Sets the global system error reporting level.
17805  Description:
17806  This function sets the global system error reporting level.
17807 
17808  Precondition:
17809  SYS_DEBUG_Initialize must have returned a valid object handle.
17810  Parameters:
17811  level - The desired system error level.
17812  Returns:
17813  None.
17814  Example:
17815  <code>
17816  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17817  </code>
17818  Remarks:
17819  None.
17820 */
17821 
17822 void
17824  SYS_ERROR_LEVEL level ) ;
17825 // *****************************************************************************
17826 /* Function:
17827  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17828  Summary:
17829  Returns the global system Error reporting level.
17830  Description:
17831  This function returns the global System Error reporting level.
17832 
17833  Precondition:
17834  SYS_DEBUG_Initialize must have returned a valid object handle.
17835  Parameters:
17836  None.
17837  Returns:
17838  The global System Error Level.
17839  Example:
17840  <code>
17841  SYS_ERROR_LEVEL level;
17842 
17843  level = SYS_DEBUG_ErrorLevelGet();
17844  </code>
17845  Remarks:
17846  None.
17847 */
17848 
17850  SYS_DEBUG_ErrorLevelGet ( void ) ;
17851 // *****************************************************************************
17852 // *****************************************************************************
17853 // Section: SYS DEBUG Macros
17854 // *****************************************************************************
17855 // *****************************************************************************
17856 // *****************************************************************************
17857 /* Macro:
17858  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17859  Summary:
17860  Prints a debug message if the specified level is at or below the global
17861  system error level.
17862  Description:
17863  This macro prints a debug message if the specified level is at or below the
17864  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17865  Precondition:
17866  SYS_DEBUG_Initialize must have returned a valid object handle.
17867  Parameters:
17868  level - The current error level threshold for displaying the message.
17869  message - Pointer to a buffer containing the message to be displayed.
17870  Returns:
17871  None.
17872  Example:
17873  <code>
17874  // In system_config.h
17875 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17876 
17877  // In library source (.c) code.
17878  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17879  </code>
17880  Remarks:
17881  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17882 
17883  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17884  function call from the source code. To access and utilize the message,
17885  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17886  SYS_DEBUG_MESSAGE macro.
17887 */
17888 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17889 // *****************************************************************************
17890 /* Macro:
17891  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17892  Summary:
17893  Formats and prints a debug message if the specified level is at or below the
17894  global system error level.
17895  Description:
17896  This function formats and prints a debug message if the specified level is
17897  at or below the global system error level. It can be used to implement the
17898  SYS_DEBUG_PRINT macro.
17899  Precondition:
17900  SYS_DEBUG_Initialize must have returned a valid object handle.
17901  Parameters:
17902  level - The current error level threshold for displaying the message.
17903  format - Pointer to a buffer containing the format string for
17904  the message to be displayed.
17905  ... - Zero or more optional parameters to be formated as
17906  defined by the format string.
17907  Returns:
17908  None.
17909  Example:
17910  <code>
17911  // In system_config.h
17912 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17913 
17914  // In source code
17915  int result;
17916 
17917  result = SomeOperation();
17918  if (result > MAX_VALUE)
17919  {
17920  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17921  // Take appropriate action
17922  }
17923  </code>
17924  Remarks:
17925  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17926 
17927  The default SYS_DEBUG_PRINT macro definition removes the message and
17928  function call from the source code. To access and utilize the message,
17929  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17930  SYS_DEBUG_PRINT macro.
17931 */
17932 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17933 // DOM-IGNORE-BEGIN
17934 // *****************************************************************************
17935 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17936  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17937  (system_config.h) will map the macros below to the appropriate system
17938  console functions.
17939 */
17940 // DOM-IGNORE-END
17941 // *****************************************************************************
17942 /* Macro:
17943  SYS_MESSAGE( const char* message )
17944  Summary:
17945  Prints a message to the console regardless of the system error level.
17946  Description:
17947  This macro is used to print a message to the console regardless of the
17948  system error level. It can be mapped to any desired implementation.
17949  Precondition:
17950  If mapped to the _SYS_MESSAGE function, then the system debug service must
17951  be initialized and running.
17952  Parameters:
17953  message - Pointer to a buffer containing the message string to be
17954  displayed.
17955  Returns:
17956  None.
17957  Example:
17958  <code>
17959  // In system_config.h:
17960 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17961 
17962  // In source (.c) files:
17963  SYS_MESSAGE("My Message\n\r");
17964  </code>
17965  Remarks:
17966  By default, this macro is defined as nothing, effectively removing all code
17967  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17968  defined in a way that maps calls to it to the desired implementation (see
17969  example, above).
17970 
17971  This macro can be mapped to the system console service (along with other
17972  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17973  configuration (system_config.h) instead of defining it individually.
17974 */
17975 #define SYS_MESSAGE( message )
17976 // *****************************************************************************
17977 /* Function:
17978  SYS_DEBUG_MESSAGE( const char* message )
17979  Summary:
17980  Prints a debug message if the system error level is defined defined at
17981  or lower than the level specified.
17982  Description:
17983  This function prints a debug message if the system error level is defined at
17984  or lower than the level specified.
17985  Precondition:
17986  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17987  Parameters:
17988  level - The current error level threshold for displaying the message.
17989  message - Pointer to a buffer containing the message to be displayed.
17990  Returns:
17991  None.
17992  Example:
17993  <code>
17994 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
17995  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
17996  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
17997  </code>
17998  Remarks:
17999  By default, this macro is defined as nothing, effectively removing all code
18000  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18001  must be defined in a way that maps calls to it to the desired implementation
18002  (see example, above).
18003 
18004  This macro can be mapped to the system console service (along with other
18005  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18006  configuration (system_config.h) instead of defining it individually.
18007 */
18008 #define SYS_DEBUG_MESSAGE( level , message )
18009 // *****************************************************************************
18010 /* Function:
18011  SYS_PRINT(const char* format, ...);
18012  Summary:
18013  Formats and prints an error message with a variable number of arguments
18014  regardless of the system error level.
18015  Description:
18016  This function formats and prints an error message with a variable number of
18017  if the system error level is defined at or lower than the level specified.
18018  Precondition:
18019  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18020  Parameters:
18021  format - Pointer to a buffer containing the format string for
18022  the message to be displayed.
18023  ... - Zero or more optional parameters to be formated as
18024  defined by the format string.
18025  Returns:
18026  None.
18027  Example:
18028  <code>
18029  // In system_config.h
18030 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18031 
18032  // In source code
18033  int result;
18034 
18035  result = SomeOperation();
18036  if (result > MAX_VALUE)
18037  {
18038  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18039  // Take appropriate action
18040  }
18041  </code>
18042  Remarks:
18043  The format string and arguments follow the printf convention. This function
18044  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18045 
18046  By default, this macro is defined as nothing, effectively removing all code
18047  generated by calls to it. To process SYS_PRINT calls, this macro must be
18048  defined in a way that maps calls to it to the desired implementation (see
18049  example, above).
18050 
18051  This macro can be mapped to the system console service (along with other
18052  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18053  configuration (system_config.h) instead of defining it individually.
18054 */
18055 #define SYS_PRINT( fmt ,... )
18056 // *****************************************************************************
18057 /* Macro:
18058  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18059  Summary:
18060  Formats and prints an error message if the system error level is defined at
18061  or lower than the level specified.
18062  Description:
18063  This macro formats and prints an error message if the system error level
18064  is defined at or lower than the level specified.o
18065  Precondition:
18066  SYS_DEBUG_Initialize must have returned a valid object handle.
18067  Parameters:
18068  level - The current error level threshold for displaying the message.
18069  format - Pointer to a buffer containing the format string for
18070  the message to be displayed.
18071  ... - Zero or more optional parameters to be formated as
18072  defined by the format string.
18073  Returns:
18074  None.
18075  Example:
18076  <code>
18077  // In system_config.h
18078 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18079 
18080  // In source code
18081  int result;
18082 
18083  result = SomeOperation();
18084  if (result > MAX_VALUE)
18085  {
18086  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18087  // Take appropriate action
18088  }
18089  </code>
18090  Remarks:
18091  The format string and arguments follow the printf convention. This function
18092  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18093 
18094  By default, this macro is defined as nothing, effectively removing all code
18095  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18096  defined in a way that maps calls to it to the desired implementation (see
18097  example, above).
18098 
18099  This macro can be mapped to the system console service (along with other
18100  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18101  configuration (system_config.h) instead of defining it individually.
18102 */
18103 #define SYS_DEBUG_PRINT( level , fmt ,... )
18104 // *****************************************************************************
18105 /* Macro:
18106  SYS_DEBUG_BreakPoint( void )
18107  Summary:
18108  Inserts a software breakpoint instruction when building in Debug mode.
18109  Description:
18110  This macro inserts a software breakpoint instruction when building in Debug
18111  mode.
18112  Precondition:
18113  None.
18114  Parameters:
18115  None.
18116  Returns:
18117  None.
18118  Example:
18119  <code>
18120  if (myDebugTestFailed)
18121  {
18122  SYS_DEBUG_BreakPoint();
18123  }
18124  </code>
18125  Remarks:
18126  Compiles out if not built for debugging.
18127 */
18128 #define SYS_DEBUG_BreakPoint( )
18129 // *****************************************************************************
18130 // *****************************************************************************
18131 // Section: SYS DEBUG Deprecated Macros
18132 // *****************************************************************************
18133 // *****************************************************************************
18134 /* Do not use these macros for new development.
18135 */
18136 //DOM-IGNORE-BEGIN
18137 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18138 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18139 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18140 //DOM-IGNORE-END
18141  // _SYS_DEBUG_H
18142 /*******************************************************************************
18143  End of File
18144 */
18145 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18146 /* CLOSE_FILE Include File */
18147 
18148 // DOM-IGNORE-BEGIN
18149 // DOM-IGNORE-END
18150 // *****************************************************************************
18151 // *****************************************************************************
18152 // Section: Data Type Definitions
18153 // *****************************************************************************
18154 // *****************************************************************************
18155 /* USART FIFO+RX(8+1) size */
18156 #define _DRV_USART_RX_DEPTH 9
18157 // *****************************************************************************
18158 /* USART Static Driver Instance Object
18159  Summary:
18160  Object used to keep any data required for the static USART driver.
18161  Description:
18162  This object is used to keep track of any data that must be maintained to
18163  manage the USART static driver.
18164  Remarks:
18165  None.
18166 */
18167 
18168 typedef
18169  struct
18170  {
18171  /* Client specific error */
18172  DRV_USART_ERROR error ;
18173  } DRV_USART_OBJ ;
18174 // *****************************************************************************
18175 // *****************************************************************************
18176 // Section: Local functions.
18177 // *****************************************************************************
18178 // *****************************************************************************
18179 // DOM-IGNORE-BEGIN
18180 // DOM-IGNORE-END
18181  //#ifndef _DRV_USART_STATIC_LOCAL_H
18182 /*******************************************************************************
18183  End of File
18184 */
18185 
18186 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18187 /* CLOSE_FILE Include File */
18188 
18189 // DOM-IGNORE-BEGIN
18190 // DOM-IGNORE-END
18191 // *********************************************************************************************
18192 // *********************************************************************************************
18193 // Section: System Interface Headers for the Instance 0 of USART static driver
18194 // *********************************************************************************************
18195 // *********************************************************************************************
18196 
18197 SYS_MODULE_OBJ
18198  DRV_USART0_Initialize ( void ) ;
18199 
18200 void
18201  DRV_USART0_Deinitialize ( void ) ;
18202 
18203 SYS_STATUS
18204  DRV_USART0_Status ( void ) ;
18205 
18206 void
18207  DRV_USART0_TasksTransmit ( void ) ;
18208 
18209 void
18210  DRV_USART0_TasksReceive ( void ) ;
18211 
18212 void
18213  DRV_USART0_TasksError ( void ) ;
18214 // *********************************************************************************************
18215 // *********************************************************************************************
18216 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18217 // *********************************************************************************************
18218 // *********************************************************************************************
18219 
18220 DRV_HANDLE
18221  DRV_USART0_Open (
18222  const SYS_MODULE_INDEX index ,
18223  const DRV_IO_INTENT ioIntent ) ;
18224 
18225 void
18226  DRV_USART0_Close ( void ) ;
18227 
18229  DRV_USART0_ClientStatus ( void ) ;
18230 
18232  DRV_USART0_TransferStatus ( void ) ;
18233 
18235  DRV_USART0_ErrorGet ( void ) ;
18236 // *********************************************************************************************
18237 // *********************************************************************************************
18238 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18239 // *********************************************************************************************
18240 // *********************************************************************************************
18241 
18242 uint8_t
18243  DRV_USART0_ReadByte ( void ) ;
18244 
18245 void
18247  const uint8_t byte ) ;
18248 
18249 unsigned int
18251 
18252 unsigned int
18254 
18255 bool
18257 
18258 bool
18260 // *********************************************************************************************
18261 // *********************************************************************************************
18262 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18263 // *********************************************************************************************
18264 // *********************************************************************************************
18265 
18268  uint32_t baud ) ;
18269 
18272  DRV_USART_LINE_CONTROL lineControlMode ) ;
18273 // DOM-IGNORE-BEGIN
18274 // DOM-IGNORE-END
18275  // #ifndef _DRV_USART_STATIC_H
18276 /*******************************************************************************
18277  End of File
18278 */
18279 
18280 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18281 /* CLOSE_FILE Include File */
18282 
18283 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18284 /*******************************************************************************
18285  Ports System Service Interface Definition
18286  Company:
18287  Microchip Technology Inc.
18288  File Name:
18289  sys_ports.h
18290  Summary:
18291  Ports System Service interface definitions
18292  Description:
18293  This file contains the interface definition for the Ports system
18294  service. It provides a way to interact with the Ports subsystem to
18295  manage the timing requests supported by the system
18296 *******************************************************************************/
18297 //DOM-IGNORE-BEGIN
18298 /*******************************************************************************
18299 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18300 Microchip licenses to you the right to use, modify, copy and distribute
18301 Software only when embedded on a Microchip microcontroller or digital signal
18302 controller that is integrated into your product or third party product
18303 (pursuant to the sublicense terms in the accompanying license agreement).
18304 You should refer to the license agreement accompanying this Software for
18305 additional information regarding your rights and obligations.
18306 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18307 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18308 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18309 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18310 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18311 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18312 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18313 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18314 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18315 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18316 *******************************************************************************/
18317 //DOM-IGNORE-END
18318 #ifndef _SYS_PORTS_H
18319 #define _SYS_PORTS_H
18320 // *****************************************************************************
18321 // *****************************************************************************
18322 // Section: Included Files
18323 // *****************************************************************************
18324 // *****************************************************************************
18325 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18326 /*******************************************************************************
18327  PORTS System Service Library Interface Definition
18328  Company:
18329  Microchip Technology Inc.
18330  File Name:
18331  sys_ports_definitions.h
18332  Summary:
18333  PORTS System Service data type definitions header.
18334  Description:
18335  This file contains data type definitions header.
18336 *******************************************************************************/
18337 //DOM-IGNORE-BEGIN
18338 /*******************************************************************************
18339 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18340 Microchip licenses to you the right to use, modify, copy and distribute
18341 Software only when embedded on a Microchip microcontroller or digital signal
18342 controller that is integrated into your product or third party product
18343 (pursuant to the sublicense terms in the accompanying license agreement).
18344 You should refer to the license agreement accompanying this Software for
18345 additional information regarding your rights and obligations.
18346 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18347 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18348 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18349 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18350 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18351 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18352 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18353 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18354 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18355 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18356 *******************************************************************************/
18357 //DOM-IGNORE-END
18358 #ifndef _SYS_PORTS_DEFINITIONS_H
18359 #define _SYS_PORTS_DEFINITIONS_H
18360 // *****************************************************************************
18361 // *****************************************************************************
18362 // Section: File includes
18363 // *****************************************************************************
18364 // *****************************************************************************
18365 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18366 #include "system/common/sys_common.h"
18367 #include "system/common/sys_module.h"
18368 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18369 /*******************************************************************************
18370  Ports Peripheral Library Interface Header
18371  Company:
18372  Microchip Technology Inc.
18373  File Name:
18374  plib_ports.h
18375  Summary:
18376  Ports Peripheral Library Interface header for Ports function definitions.
18377  Description:
18378  This header file contains the function prototypes and definitions of
18379  the data types and constants that make up the interface to the Ports
18380  Peripheral Library for all families of Microchip microcontrollers. The
18381  definitions in this file are common to the Ports peripheral.
18382 *******************************************************************************/
18383 // DOM-IGNORE-BEGIN
18384 /*******************************************************************************
18385 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18386 Microchip licenses to you the right to use, modify, copy and distribute
18387 Software only when embedded on a Microchip microcontroller or digital signal
18388 controller that is integrated into your product or third party product
18389 (pursuant to the sublicense terms in the accompanying license agreement).
18390 You should refer to the license agreement accompanying this Software for
18391 additional information regarding your rights and obligations.
18392 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18393 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18394 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18395 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18396 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18397 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18398 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18399 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18400 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18401 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18402 *******************************************************************************/
18403 // DOM-IGNORE-END
18404 #ifndef _PLIB_PORTS_H
18405 #define _PLIB_PORTS_H
18406 #include <stdint.h>
18407 #include <stddef.h>
18408 // DOM-IGNORE-BEGIN
18409 // DOM-IGNORE-END
18410 // *****************************************************************************
18411 // *****************************************************************************
18412 // Section: Constants & Data Types
18413 // *****************************************************************************
18414 // *****************************************************************************
18415 // *****************************************************************************
18416 /* Ports data mask definition
18417  Summary:
18418  Data type defining the Ports data mask
18419  Description:
18420  This data type defines the Ports data mask
18421  Remarks:
18422  None.
18423 */
18424 
18425 typedef
18426 uint16_t
18428 // *****************************************************************************
18429 /* Ports data type definition
18430  Summary:
18431  Data type defining the Ports data type.
18432  Description:
18433  This data type defines the Ports data type.
18434  Remarks:
18435  None.
18436 */
18437 
18438 typedef
18439 uint32_t
18441 // *****************************************************************************
18442 // *****************************************************************************
18443 // Section: Included Files (continued at end of file)
18444 // *****************************************************************************
18445 // *****************************************************************************
18446 /* This section lists the other files that are included in this file. However,
18447  please see the end of the file for additional implementation header files
18448  that are also included.
18449 */
18450 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18451 //DOM-IGNORE-BEGIN
18452 /*******************************************************************************
18453 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18454 Microchip licenses to you the right to use, modify, copy and distribute
18455 Software only when embedded on a Microchip microcontroller or digital signal
18456 controller that is integrated into your product or third party product
18457 (pursuant to the sublicense terms in the accompanying license agreement).
18458 You should refer to the license agreement accompanying this Software for
18459 additional information regarding your rights and obligations.
18460 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18461 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18462 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18463 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18464 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18465 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18466 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18467 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18468 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18469 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18470  *******************************************************************************/
18471 //DOM-IGNORE-END
18472 #ifndef _PLIB_PORTS_PROCESSOR_H
18473 #define _PLIB_PORTS_PROCESSOR_H
18474 #error "Can't find header"
18475 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18476 /* CLOSE_FILE Include File */
18477 
18478 // *****************************************************************************
18479 // *****************************************************************************
18480 // Section: Ports Peripheral Library Interface Routines
18481 // *****************************************************************************
18482 // *****************************************************************************
18483 // *****************************************************************************
18484 /* Function:
18485  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18486  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18487  PORTS_REMAP_INPUT_PIN remapInputPin );
18488  Summary:
18489  Input function remapping.
18490  Description:
18491  This function controls the Input function remapping. It allows user to map
18492  any of the input functionality on any of the remappable input pin.
18493  This function does not perform atomic register access.
18494  Precondition:
18495  IOLOCK bit of configuration register should be clear to allow any remapping.
18496  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18497  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18498  find more information.
18499  Parameters:
18500  index - Identifier for the device instance to be configured
18501  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18502  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18503  Returns:
18504  None.
18505  Example:
18506  <code>
18507 
18508  // System Unlock
18509  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18510  // Unlock PPS registers
18511  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18512  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18513  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18514  </code>
18515  Remarks:
18516  This feature may not be available on all devices. Please refer to the
18517  specific device data sheet to determine availability or use
18518  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18519  this feature is available.
18520 */
18521 
18522 void
18524  PORTS_MODULE_ID index ,
18525  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18526  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18527 // *****************************************************************************
18528 /* Function:
18529  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18530  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18531  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18532  Summary:
18533  Output function remapping.
18534  Description:
18535  This function controls the Output function remapping. it allows user to map
18536  any of the output functionality on any of the remappable output pin.
18537  This function does not perform atomic register access.
18538  Precondition:
18539  IOLOCK bit of configuration register should be clear to allow any remapping.
18540  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18541  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18542  find more information.
18543  Parameters:
18544  index - Identifier for the device instance to be configured
18545  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18546  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18547  Returns:
18548  None.
18549  Example:
18550  <code>
18551 
18552  // System Unlock
18553  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18554  // Unlock PPS registers
18555  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18556  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18557  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18558 
18559  </code>
18560  Remarks:
18561  This feature may not be available on all devices. Please refer to the
18562  specific device data sheet to determine availability or use
18563  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18564  this feature is available.
18565 */
18566 
18567 void
18569  PORTS_MODULE_ID index ,
18570  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18571  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18572 // *****************************************************************************
18573 /* Function:
18574  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18575  PORTS_ANALOG_PIN pin,
18576  PORTS_PIN_MODE mode );
18577  Summary:
18578  Enables the selected pin as analog or digital.
18579  Description:
18580  This function enables the selected pin as analog or digital.
18581  This function does not perform atomic register access.
18582  Precondition:
18583  None.
18584  Parameters:
18585  index - Identifier for the device instance to be configured
18586  pin - Possible values of PORTS_ANALOG_PIN
18587  mode - Possible values of PORTS_PIN_MODE
18588  Returns:
18589  None.
18590  Example:
18591  <code>
18592 
18593  // Make AN0 pin as Analog
18594  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18595 
18596  </code>
18597  Remarks:
18598  This feature may not be available on all devices. Please refer to the
18599  specific device data sheet to determine availability or use
18600  PLIB_PORTS_ExistsPinMode in your application to determine whether
18601  this feature is available.
18602 */
18603 
18604 void
18606  PORTS_MODULE_ID index ,
18607  PORTS_ANALOG_PIN pin ,
18608  PORTS_PIN_MODE mode ) ;
18609 // *****************************************************************************
18610 /* Function:
18611  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18612  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18613  PORTS_PIN_MODE mode );
18614  Summary:
18615  Enables the selected port pin as analog or digital.
18616  Description:
18617  This function enables the selected port pin as analog or digital.
18618  This function does not perform atomic register access.
18619  Precondition:
18620  None.
18621  Parameters:
18622  index - Identifier for the device instance to be configured
18623  channel - Port pin channel
18624  bitPos - Position in the PORT pins
18625  mode - Possible values of PORTS_PIN_MODE
18626  Returns:
18627  None.
18628  Example:
18629  <code>
18630 
18631  // Make RC5 pin Analog
18632  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18633  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18634 
18635  </code>
18636  Remarks:
18637  This function is only available in devices with PPS. For Non-PPS devices, use the
18638  PLIB_PORTS_PinModeSelect function.
18639 
18640  This feature may not be available on all devices. Please refer to the
18641  specific device data sheet to determine availability or use
18642  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18643  this feature is available.
18644 */
18645 
18646 void
18648  PORTS_MODULE_ID index ,
18649  PORTS_CHANNEL channel ,
18650  PORTS_BIT_POS bitPos ,
18651  PORTS_PIN_MODE mode ) ;
18652 // *****************************************************************************
18653 /* Function:
18654  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18655  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18656  Summary:
18657  Enables the pull-down for selected Change Notice pins.
18658  Description:
18659  This function enables the pull-down for selected Change Notice pins.
18660  This function does not perform atomic register access.
18661  Precondition:
18662  None.
18663  Parameters:
18664  index - Identifier for the device instance to be configured
18665  channel - Port pin channel
18666  bitPos - Position in the PORT pins
18667  Returns:
18668  None.
18669  Example:
18670  <code>
18671 
18672  // Enable pull-down for RC5 pin
18673  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18674  PORTS_BIT_POS_5);
18675 
18676  </code>
18677  Remarks:
18678  This feature may not be available on all devices. Please refer to the
18679  specific device data sheet to determine availability or use
18680  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18681  determine whether this feature is available.
18682 */
18683 
18684 void
18686  PORTS_MODULE_ID index ,
18687  PORTS_CHANNEL channel ,
18688  PORTS_BIT_POS bitPos ) ;
18689 // *****************************************************************************
18690 /* Function:
18691  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18692  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18693  Summary:
18694  Disables the pull-down for selected Change Notice pins.
18695  Description:
18696  This function disables the pull-down for selected Change Notice pins.
18697  This function does not perform atomic register access.
18698  Precondition:
18699  None.
18700  Parameters:
18701  index - Identifier for the device instance to be configured
18702  channel - Port pin channel
18703  bitPos - Position in the PORT pins
18704  Returns:
18705  None.
18706  Example:
18707  <code>
18708 
18709  // Disable pull-down for RC5 pin
18710  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18711  PORTS_BIT_POS_5);
18712  </code>
18713  Remarks:
18714  This feature may not be available on all devices. Please refer to the
18715  specific device data sheet to determine availability or use
18716  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18717  determine whether this feature is available.
18718 */
18719 
18720 void
18722  PORTS_MODULE_ID index ,
18723  PORTS_CHANNEL channel ,
18724  PORTS_BIT_POS bitPos ) ;
18725 // *****************************************************************************
18726 /* Function:
18727  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18728  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18729  Summary:
18730  Enables the pull-up for selected Change Notice pins.
18731  Description:
18732  This function enables the pull-up for selected Change Notice pins.
18733  This function does not perform atomic register access.
18734  Precondition:
18735  None.
18736  Parameters:
18737  index - Identifier for the device instance to be configured
18738  channel - Port pin channel
18739  bitPos - Position in the PORT pins
18740  Returns:
18741  None.
18742  Example:
18743  <code>
18744 
18745  // Enable pull-up for RC5 pin
18746  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18747  PORTS_BIT_POS_5);
18748  </code>
18749  Remarks:
18750  This function is only available in devices with PPS. For Non-PPS devices, use the
18751  PLIB_PORTS_ChangeNoticePullUpEnable function.
18752 
18753  This feature may not be available on all devices. Please refer to the
18754  specific device data sheet to determine availability or use
18755  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18756  determine whether this feature is available.
18757 */
18758 
18759 void
18761  PORTS_MODULE_ID index ,
18762  PORTS_CHANNEL channel ,
18763  PORTS_BIT_POS bitPos ) ;
18764 // *****************************************************************************
18765 /* Function:
18766  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18767  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18768  Summary:
18769  Disables weak pull-up for the selected pin.
18770  Description:
18771  This function disables weak pull-up for the selected port pin.
18772  This function does not perform atomic register access.
18773  Precondition:
18774  None.
18775  Parameters:
18776  index - Identifier for the device instance to be configured
18777  channel - Port pin channel
18778  bitPos - Position in the PORT pins
18779  Returns:
18780  None.
18781  Example:
18782  <code>
18783 
18784  // Disable pull-up for RC5 pin
18785  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18786  PORTS_BIT_POS_5);
18787 
18788  </code>
18789  Remarks:
18790  This function is only available in devices with PPS. For Non-PPS devices, use the
18791  PLIB_PORTS_ChangeNoticePullUpDisable function.
18792 
18793  Pull-ups on change notification pins should always be disabled when the
18794  port pin is configured as a digital output.
18795 
18796  This feature may not be available on all devices. Please refer to the
18797  specific device data sheet to determine availability or use
18798  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18799  determine whether this feature is available.
18800 */
18801 
18802 void
18804  PORTS_MODULE_ID index ,
18805  PORTS_CHANNEL channel ,
18806  PORTS_BIT_POS bitPos ) ;
18807 // *****************************************************************************
18808 /* Function:
18809  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18810  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18811  Summary:
18812  Enables CN interrupt for the selected pin.
18813  Description:
18814  This function enables Change Notice interrupt for the selected port pin.
18815  This function does not perform atomic register access.
18816 
18817  Precondition:
18818  None.
18819  Parameters:
18820  index - Identifier for the device instance to be configured
18821  channel - Port pin channel
18822  bitPos - Position in the PORT pins
18823  Returns:
18824  None.
18825  Example:
18826  <code>
18827 
18828  // Enable CN interrupt for RC5 pin
18829  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18830  PORTS_BIT_POS_5);
18831 
18832  </code>
18833  Remarks:
18834  This function is only available in devices with PPS. For Non-PPS devices, use the
18835  PLIB_PORTS_PinChangeNoticeEnable function.
18836 
18837  This feature may not be available on all devices. Please refer to the
18838  specific device data sheet to determine availability or use
18839  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18840  determine whether this feature is available.
18841 */
18842 
18843 void
18845  PORTS_MODULE_ID index ,
18846  PORTS_CHANNEL channel ,
18847  PORTS_BIT_POS bitPos ) ;
18848 // *****************************************************************************
18849 /* Function:
18850  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18851  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18852  Summary:
18853  Disables CN interrupt for the selected pin.
18854  Description:
18855  This function disables Change Notice interrupt for the selected port pin.
18856  This function does not perform atomic register access.
18857  Precondition:
18858  None.
18859  Parameters:
18860  index - Identifier for the device instance to be configured
18861  channel - Port pin channel
18862  bitPos - Position in the PORT pins
18863  Returns:
18864  None.
18865  Example:
18866  <code>
18867 
18868  // Disable CN interrupt for RC5 pin
18869  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18870  PORTS_BIT_POS_5);
18871 
18872  </code>
18873  Remarks:
18874  This function is only available in devices with PPS. For Non-PPS devices, use the
18875  PLIB_PORTS_PinChangeNoticeDisable function.
18876 
18877  This feature may not be available on all devices. Please refer to the
18878  specific device data sheet to determine availability or use
18879  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18880  determine whether this feature is available.
18881 */
18882 
18883 void
18885  PORTS_MODULE_ID index ,
18886  PORTS_CHANNEL channel ,
18887  PORTS_BIT_POS bitPos ) ;
18888 // *****************************************************************************
18889 /* Function:
18890  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18891  PORTS_CHANNEL channel );
18892  Summary:
18893  Enables the change notification for selected port.
18894  Description:
18895  This function enables the change notification for selected port.
18896  This function does not perform atomic register access.
18897  Precondition:
18898  None.
18899  Parameters:
18900  index - Identifier for the device instance to be configured
18901  channel - Port pin channel
18902  Returns:
18903  None.
18904  Example:
18905  <code>
18906  // Enable Change notification for Port C
18907  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18908 
18909  </code>
18910  Remarks:
18911  This function is only available in devices with PPS. For Non-PPS devices, use the
18912  PLIB_PORTS_ChangeNoticeEnable function.
18913 
18914  This feature may not be available on all devices. Please refer to the
18915  specific device data sheet to determine availability or use
18916  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18917  whether this feature is available.
18918 */
18919 
18920 void
18922  PORTS_MODULE_ID index ,
18923  PORTS_CHANNEL channel ) ;
18924 // *****************************************************************************
18925 /* Function:
18926  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18927  PORTS_CHANNEL channel );
18928  Summary:
18929  Disables the change notification for selected port.
18930  Description:
18931  This function disables the change notification for selected port.
18932  This function does not perform atomic register access.
18933  Precondition:
18934  None.
18935  Parameters:
18936  index - Identifier for the device instance to be configured
18937  channel - Port pin channel
18938  Returns:
18939  None.
18940  Example:
18941  <code>
18942  // Disable Change notification for Port C
18943  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18944 
18945  </code>
18946  Remarks:
18947  This function is only available in devices with PPS. For Non-PPS devices, use the
18948  PLIB_PORTS_ChangeNoticeDisable function.
18949 
18950  This feature may not be available on all devices. Please refer to the
18951  specific device data sheet to determine availability or use
18952  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18953  whether this feature is available.
18954 */
18955 
18956 void
18958  PORTS_MODULE_ID index ,
18959  PORTS_CHANNEL channel ) ;
18960 // *****************************************************************************
18961 /* Function:
18962  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18963  PORTS_CHANNEL channel );
18964  Summary:
18965  Allows CN to be working in Idle mode for selected channel.
18966  Description:
18967  This function makes sure that change notification feature keeps working in
18968  Idle mode for the selected channel.
18969  This function does not perform atomic register access.
18970  Precondition:
18971  None.
18972  Parameters:
18973  index - Identifier for the device instance to be configured
18974  channel - Port pin channel
18975  Returns:
18976  None.
18977  Example:
18978  <code>
18979 
18980  // Change notification continues working in Idle mode for Port C
18981  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18982 
18983  </code>
18984  Remarks:
18985  This function is only available in devices with PPS. For Non-PPS devices, use the
18986  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18987 
18988  This feature may not be available on all devices. Please refer to the
18989  specific device data sheet to determine availability or use
18990  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18991  whether this feature is available.
18992 */
18993 
18994 void
18996  PORTS_MODULE_ID index ,
18997  PORTS_CHANNEL channel ) ;
18998 // *****************************************************************************
18999 /* Function:
19000  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19001  PORTS_CHANNEL channel );
19002  Summary:
19003  Change Notification halts in Idle mode for selected channel.
19004  Description:
19005  This function makes sure that change notification feature halts in
19006  Idle mode for the selected channel.
19007  This function does not perform atomic register access.
19008  Precondition:
19009  None.
19010  Parameters:
19011  index - Identifier for the device instance to be configured
19012  channel - Port pin channel
19013  Returns:
19014  None.
19015  Example:
19016  <code>
19017 
19018  // Change notification halts in Idle mode for Port C
19019  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19020 
19021  </code>
19022  Remarks:
19023  This function is only available in devices with PPS. For Non-PPS devices, use the
19024  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19025 
19026  This feature may not be available on all devices. Please refer to the
19027  specific device data sheet to determine availability or use
19028  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19029  whether this feature is available.
19030 */
19031 
19032 void
19034  PORTS_MODULE_ID index ,
19035  PORTS_CHANNEL channel ) ;
19036 // *****************************************************************************
19037 /* Function:
19038  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19039  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19040  Summary:
19041  checks the status of change on the pin
19042  Description:
19043  This function checks if the change has occurred on the given pin or not.
19044  This function does not perform atomic register access.
19045  Precondition:
19046  None.
19047  Parameters:
19048  index - Identifier for the device instance to be configured
19049  channel - Port pin channel
19050  bitPos - Position in the PORT pins
19051  Returns:
19052  None.
19053  Example:
19054  <code>
19055 
19056  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19057  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19058  {
19059  //do something
19060  }
19061 
19062  </code>
19063  Remarks:
19064  This feature may not be available on all devices. Please refer to the
19065  specific device data sheet to determine availability or use
19066  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19067  whether this feature is available.
19068 */
19069 
19070 bool
19072  PORTS_MODULE_ID index ,
19073  PORTS_CHANNEL channel ,
19074  PORTS_BIT_POS bitPos ) ;
19075 // *****************************************************************************
19076 /* Function:
19077  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19078  PORTS_BIT_POS bitPos )
19079  Summary:
19080  Reads/Gets data from the selected digital pin.
19081  Description:
19082  This function reads/gets data from the selected digital PORT i/o pin.
19083  This function should be used to read the live data at the pin.
19084  This function does not perform atomic register access.
19085 
19086  Precondition:
19087  None.
19088  Parameters:
19089  index - Identifier for the device instance to be configured
19090  channel - Identifier for the Ports channel A, B, C, etc.
19091  bitPos - Possible values of PORTS_BIT_POS
19092  Returns:
19093  Port pin read data.
19094  Example:
19095  <code>
19096  // read port pin RC4
19097  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19098  PORTS_BIT_POS_4);
19099  </code>
19100  Remarks:
19101  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19102 
19103  This feature may not be available on all devices. Please refer to the
19104  specific device data sheet to determine availability or use
19105  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19106  this feature is available.
19107 */
19108 
19109 bool
19111  PORTS_MODULE_ID index ,
19112  PORTS_CHANNEL channel ,
19113  PORTS_BIT_POS bitPos ) ;
19114 // *****************************************************************************
19115 /* Function:
19116  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19117  PORTS_BIT_POS bitPos )
19118  Summary:
19119  Reads/Gets data from the selected latch.
19120  Description:
19121  This function reads/gets data from the selected PORTx Data Latch, not from
19122  the port I/O pins.
19123  This function does not perform atomic register access.
19124 
19125  Precondition:
19126  None.
19127  Parameters:
19128  index - Identifier for the device instance to be configured
19129  channel - Identifier for the Ports channel A, B, C, etc.
19130  bitPos - Possible values of PORTS_BIT_POS
19131  Returns:
19132  Latch read data.
19133  Example:
19134  <code>
19135  // read latch RC4
19136  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19137  PORTS_BIT_POS_4);
19138  </code>
19139  Remarks:
19140  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19141  should be used.
19142 
19143  This feature may not be available on all devices. Please refer to the
19144  specific device data sheet to determine availability or use
19145  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19146  this feature is available.
19147 */
19148 
19149 bool
19151  PORTS_MODULE_ID index ,
19152  PORTS_CHANNEL channel ,
19153  PORTS_BIT_POS bitPos ) ;
19154 // *****************************************************************************
19155 /* Function:
19156  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19157  PORTS_BIT_POS bitPos,
19158  bool value )
19159  Summary:
19160  Writes the selected digital pin/latch.
19161  Description:
19162  This function writes to the selected digital pin/latch.
19163  This function does not perform atomic register access.
19164  Precondition:
19165  None.
19166  Parameters:
19167  index - Identifier for the device instance to be configured
19168  channel - Identifier for the Ports channel A, B, C, etc.
19169  bitPos - Possible values of PORTS_BIT_POS
19170  value - Value to be written to the specific pin/latch
19171  true - sets the bit, false - clears the bit
19172  Returns:
19173  None.
19174  Example:
19175  <code>
19176 
19177  // write 'one' in port RC4
19178  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19179 
19180  </code>
19181  Remarks:
19182  This feature may not be available on all devices. Please refer to the
19183  specific device data sheet to determine availability or use
19184  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19185  this feature is available.
19186 */
19187 
19188 void
19190  PORTS_MODULE_ID index ,
19191  PORTS_CHANNEL channel ,
19192  PORTS_BIT_POS bitPos ,
19193  bool value ) ;
19194 // *****************************************************************************
19195 /* Function:
19196  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19197  PORTS_BIT_POS bitPos )
19198  Summary:
19199  Sets the selected digital pin/latch.
19200  Description:
19201  This function sets the selected digital pin/latch.
19202  This function does not perform atomic register access.
19203  Precondition:
19204  None.
19205  Parameters:
19206  index - Identifier for the device instance to be configured
19207  channel - Identifier for the Ports channel A, B, C, etc.
19208  bitPos - Possible values of PORTS_BIT_POS
19209  Returns:
19210  None.
19211  Example:
19212  <code>
19213 
19214  // Sets port pin RC4
19215  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19216 
19217  </code>
19218  Remarks:
19219  This feature may not be available on all devices. Please refer to the
19220  specific device data sheet to determine availability or use
19221  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19222  this feature is available.
19223 */
19224 
19225 void
19227  PORTS_MODULE_ID index ,
19228  PORTS_CHANNEL channel ,
19229  PORTS_BIT_POS bitPos ) ;
19230 // *****************************************************************************
19231 /* Function:
19232  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19233  PORTS_BIT_POS bitPos )
19234  Summary:
19235  Clears the selected digital pin/latch.
19236  Description:
19237  This function clears the selected digital pin/latch.
19238  This function does not perform atomic register access.
19239  Precondition:
19240  None.
19241  Parameters:
19242  index - Identifier for the device instance to be configured
19243  channel - Identifier for the Ports channel A, B, C, etc.
19244  bitPos - Possible values of PORTS_BIT_POS
19245  Returns:
19246  None.
19247  Example:
19248  <code>
19249 
19250  // Clears port pin RC4
19251  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19252 
19253  </code>
19254  Remarks:
19255  This feature may not be available on all devices. Please refer to the
19256  specific device data sheet to determine availability or use
19257  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19258  this feature is available.
19259 */
19260 
19261 void
19263  PORTS_MODULE_ID index ,
19264  PORTS_CHANNEL channel ,
19265  PORTS_BIT_POS bitPos ) ;
19266 // *****************************************************************************
19267 /* Function:
19268  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19269  PORTS_BIT_POS bitPos )
19270  Summary:
19271  Toggles the selected digital pin/latch.
19272  Description:
19273  This function toggles the selected digital pin/latch.
19274  This function does not perform atomic register access.
19275  Precondition:
19276  None.
19277  Parameters:
19278  index - Identifier for the device instance to be configured
19279  channel - Identifier for the Ports channel A, B, C, etc.
19280  bitPos - Possible values of PORTS_BIT_POS
19281  Returns:
19282  None.
19283  Example:
19284  <code>
19285 
19286  // Toggles port pin RC4
19287  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19288 
19289  </code>
19290  Remarks:
19291  This feature may not be available on all devices. Please refer to the
19292  specific device data sheet to determine availability or use
19293  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19294  this feature is available.
19295 */
19296 
19297 void
19299  PORTS_MODULE_ID index ,
19300  PORTS_CHANNEL channel ,
19301  PORTS_BIT_POS bitPos ) ;
19302 // *****************************************************************************
19303 /* Function:
19304  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19305  PORTS_BIT_POS bitPos )
19306  Summary:
19307  Makes the selected pin direction input
19308  Description:
19309  This function makes the selected pin direction as input
19310  This function does not perform atomic register access.
19311  Precondition:
19312  None.
19313  Parameters:
19314  index - Identifier for the device instance to be configured
19315  channel - Identifier for the Ports channel A, B, C, etc.
19316  bitPos - Possible values of PORTS_BIT_POS direction that has to
19317  be made input
19318  Returns:
19319  None.
19320  Example:
19321  <code>
19322 
19323  // make pin RC4 as input
19324  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19325 
19326  </code>
19327  Remarks:
19328  This feature may not be available on all devices. Please refer to the
19329  specific device data sheet to determine availability or use
19330  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19331  this feature is available.
19332 */
19333 
19334 void
19336  PORTS_MODULE_ID index ,
19337  PORTS_CHANNEL channel ,
19338  PORTS_BIT_POS bitPos ) ;
19339 // *****************************************************************************
19340 /* Function:
19341  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19342  PORTS_BIT_POS bitPos )
19343  Summary:
19344  Makes the selected pin direction output
19345  Description:
19346  This function makes the selected pin direction as output
19347  This function does not perform atomic register access.
19348  Precondition:
19349  None.
19350  Parameters:
19351  index - Identifier for the device instance to be configured
19352  channel - Identifier for the Ports channel A, B, C, etc.
19353  bitPos - Possible values of PORTS_BIT_POS direction that has to
19354  be made output
19355  Returns:
19356  None.
19357  Example:
19358  <code>
19359 
19360  // make pin RC4 as output
19361  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19362 
19363  </code>
19364  Remarks:
19365  This feature may not be available on all devices. Please refer to the
19366  specific device data sheet to determine availability or use
19367  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19368  this feature is available.
19369 */
19370 
19371 void
19373  PORTS_MODULE_ID index ,
19374  PORTS_CHANNEL channel ,
19375  PORTS_BIT_POS bitPos ) ;
19376 // *****************************************************************************
19377 /* Function:
19378  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19379  PORTS_BIT_POS bitPos )
19380  Summary:
19381  Enables the open drain functionality for the selected pin.
19382  Description:
19383  This function enables the open drain functionality for the selected pin.
19384  This function does not perform atomic register access.
19385  Precondition:
19386  None.
19387  Parameters:
19388  index - Identifier for the device instance to be configured
19389  channel - Identifier for the Ports channel A, B, C, etc.
19390  bitPos - Possible values of PORTS_BIT_POS
19391  Returns:
19392  None.
19393  Example:
19394  <code>
19395 
19396  // Enable open drain for pin RC4
19397  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19398 
19399  </code>
19400  Remarks:
19401  This feature may not be available on all devices. Please refer to the
19402  specific device data sheet to determine availability or use
19403  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19404  this feature is available.
19405 */
19406 
19407 void
19409  PORTS_MODULE_ID index ,
19410  PORTS_CHANNEL channel ,
19411  PORTS_BIT_POS bitPos ) ;
19412 // *****************************************************************************
19413 /* Function:
19414  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19415  PORTS_BIT_POS bitPos )
19416  Summary:
19417  Disables the open drain functionality for the selected pin.
19418  Description:
19419  This function disables the open drain functionality for the selected pin.
19420  This function does not perform atomic register access.
19421  Precondition:
19422  None.
19423  Parameters:
19424  index - Identifier for the device instance to be configured
19425  channel - Identifier for the Ports channel A, B, C, etc.
19426  bitPos - One of the possible values of PORTS_BIT_POS.
19427  Returns:
19428  None.
19429  Example:
19430  <code>
19431 
19432  // Disable open drain for pin RC4
19433  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19434 
19435  </code>
19436  Remarks:
19437  This feature may not be available on all devices. Please refer to the
19438  specific device data sheet to determine availability or use
19439  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19440  this feature is available.
19441 */
19442 
19443 void
19445  PORTS_MODULE_ID index ,
19446  PORTS_CHANNEL channel ,
19447  PORTS_BIT_POS bitPos ) ;
19448 // *****************************************************************************
19449 /* Function:
19450  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19451  (
19452  PORTS_MODULE_ID index,
19453  PORTS_CHANNEL channel
19454  )
19455  Summary:
19456  Reads and returns data from the selected Latch.
19457  Description:
19458  This function reads and returns the data from the selected Latch.
19459  This function does not perform atomic register access.
19460 
19461  Precondition:
19462  None.
19463  Parameters:
19464  index - Identifier for the device instance to be configured
19465  channel - Identifier for the Ports channel A, B, C, etc.
19466  Returns:
19467  Latch read data.
19468  Example:
19469  <code>
19470  // Read latch C
19471  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19472 
19473  </code>
19474  Remarks:
19475  For reading the Live data, PLIB_PORTS_Read function should be used.
19476 
19477  This feature may not be available on all devices. Please refer to the
19478  specific device data sheet to determine availability or use
19479  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19480  this feature is available.
19481 */
19482 
19485  PORTS_MODULE_ID index ,
19486  PORTS_CHANNEL channel ) ;
19487 // *****************************************************************************
19488 /* Function:
19489  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19490  Summary:
19491  Reads the selected digital port.
19492  Description:
19493  This function reads from the selected digital port.
19494  This function does not perform atomic register access.
19495  Precondition:
19496  None.
19497  Parameters:
19498  index - Identifier for the device instance to be configured
19499  channel - Identifier for the Ports channel A, B, C, etc.
19500  Returns:
19501  data on a port with width PORTS_DATA_TYPE
19502  Example:
19503  <code>
19504 
19505  // Read PORT C
19506  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19507 
19508  </code>
19509  Remarks:
19510  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19511 
19512  This feature may not be available on all devices. Please refer to the
19513  specific device data sheet to determine availability or use
19514  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19515  this feature is available.
19516 */
19517 
19519  PLIB_PORTS_Read (
19520  PORTS_MODULE_ID index ,
19521  PORTS_CHANNEL channel ) ;
19522 // *****************************************************************************
19523 /* Function:
19524  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19525  PORTS_DATA_TYPE value )
19526  Summary:
19527  Writes the selected digital port/latch.
19528  Description:
19529  This function writes to the selected digital port/latch.
19530  This function does not perform atomic register access.
19531  Precondition:
19532  None.
19533  Parameters:
19534  index - Identifier for the device instance to be configured
19535  channel - Identifier for the Ports channel A, B, C, etc.
19536  value - Value to be written into a port of width PORTS_DATA_TYPE
19537  Returns:
19538  None.
19539  Example:
19540  <code>
19541 
19542  // Write 0x12 into PORT C
19543  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19544 
19545  </code>
19546  Remarks:
19547  This feature may not be available on all devices. Please refer to the
19548  specific device data sheet to determine availability or use
19549  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19550  this feature is available.
19551 */
19552 
19553 void
19555  PORTS_MODULE_ID index ,
19556  PORTS_CHANNEL channel ,
19557  PORTS_DATA_TYPE value ) ;
19558 // *****************************************************************************
19559 /* Function:
19560  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19561  PORTS_DATA_TYPE value,
19562  PORTS_DATA_MASK mask )
19563  Summary:
19564  Sets the selected bits of the port.
19565  Description:
19566  This function performs an 'AND' operation on the value and mask parameters,
19567  and then sets the bits in the port channel that were set by the result of the
19568  'AND' operation.
19569  This function does not perform atomic register access.
19570  Precondition:
19571  None.
19572  Parameters:
19573  index - Identifier for the device instance to be configured
19574  channel - Identifier for the Ports channel A, B, C, etc.
19575  value - Consists of information about which port bit has to be
19576  set and which not
19577  mask - Identifies the bits which could be intended for setting
19578  Returns:
19579  None.
19580  Example:
19581  <code>
19582 
19583  // MY_VALUE - 0x1234
19584  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19585 
19586  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19587  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19588 
19589  </code>
19590  Remarks:
19591  This feature may not be available on all devices. Please refer to the
19592  specific device data sheet to determine availability or use
19593  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19594  this feature is available.
19595 */
19596 
19597 void
19598  PLIB_PORTS_Set (
19599  PORTS_MODULE_ID index ,
19600  PORTS_CHANNEL channel ,
19601  PORTS_DATA_TYPE value ,
19602  PORTS_DATA_MASK mask ) ;
19603 // *****************************************************************************
19604 /* Function:
19605  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19606  PORTS_DATA_MASK toggleMask )
19607  Summary:
19608  Toggles the selected digital port/latch.
19609  Description:
19610  This function toggles the selected digital port/latch.
19611  This function does not perform atomic register access.
19612  Precondition:
19613  None.
19614  Parameters:
19615  index - Identifier for the device instance to be configured
19616  channel - Identifier for the Ports channel A, B, C, etc.
19617  toggleMask - Identifies the bits to be toggled
19618  Returns:
19619  None.
19620  Example:
19621  <code>
19622 
19623  // Toggles the three least significant Port C bits
19624  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19625 
19626  </code>
19627  Remarks:
19628  This feature may not be available on all devices. Please refer to the
19629  specific device data sheet to determine availability or use
19630  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19631  this feature is available.
19632 */
19633 
19634 void
19636  PORTS_MODULE_ID index ,
19637  PORTS_CHANNEL channel ,
19638  PORTS_DATA_MASK toggleMask ) ;
19639 // *****************************************************************************
19640 /* Function:
19641  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19642  PORTS_DATA_MASK clearMask )
19643  Summary:
19644  Clears the selected digital port/latch bits.
19645  Description:
19646  This function clears the selected digital port/latch bits.
19647  This function does not perform atomic register access.
19648  Precondition:
19649  None.
19650  Parameters:
19651  index - Identifier for the device instance to be configured
19652  channel - Identifier for the Ports channel A, B, C, etc.
19653  clearMask - Identifies the bits to be cleared
19654  Returns:
19655  None.
19656  Example:
19657  <code>
19658 
19659  // Clears the three least significant Port C bits
19660  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19661 
19662  </code>
19663  Remarks:
19664  This feature may not be available on all devices. Please refer to the
19665  specific device data sheet to determine availability or use
19666  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19667  this feature is available.
19668 */
19669 
19670 void
19672  PORTS_MODULE_ID index ,
19673  PORTS_CHANNEL channel ,
19674  PORTS_DATA_MASK clearMask ) ;
19675 // *****************************************************************************
19676 /* Function:
19677  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19678  PORTS_DATA_MASK mask )
19679  Summary:
19680  Makes the selected pins direction input.
19681  Description:
19682  This function makes the selected pins direction input.
19683  This function does not perform atomic register access.
19684 
19685  Precondition:
19686  None.
19687  Parameters:
19688  index - Identifier for the device instance to be configured
19689  channel - Identifier for the Ports channel A, B, C, etc.
19690  mask - Identifies the pins direction that has to be made input
19691  Returns:
19692  None.
19693  Example:
19694  <code>
19695 
19696  // Make RC0, RC1 and RC2 pins as Input
19697  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19698 
19699  </code>
19700  Remarks:
19701  This feature may not be available on all devices. Please refer to the
19702  specific device data sheet to determine availability or use
19703  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19704  this feature is available.
19705 */
19706 
19707 void
19709  PORTS_MODULE_ID index ,
19710  PORTS_CHANNEL channel ,
19711  PORTS_DATA_MASK mask ) ;
19712 // *****************************************************************************
19713 /* Function:
19714  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19715  PORTS_DATA_MASK mask )
19716  Summary:
19717  Makes the selected pins direction output.
19718  Description:
19719  This function makes the selected pins direction output.
19720  This function does not perform atomic register access.
19721  Precondition:
19722  None.
19723  Parameters:
19724  index - Identifier for the device instance to be configured
19725  channel - Identifier for the Ports channel A, B, C, etc.
19726  mask - Identifies the pins direction that has to be made output
19727  Returns:
19728  None.
19729  Example:
19730  <code>
19731 
19732  // Make RC0, RC1 and RC2 pins as Output
19733  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19734 
19735  </code>
19736  Remarks:
19737  This feature may not be available on all devices. Please refer to the
19738  specific device data sheet to determine availability or use
19739  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19740  this feature is available.
19741 */
19742 
19743 void
19745  PORTS_MODULE_ID index ,
19746  PORTS_CHANNEL channel ,
19747  PORTS_DATA_MASK mask ) ;
19748 // *****************************************************************************
19749 /* Function:
19750  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19751  Summary:
19752  Reads the direction of the selected digital port.
19753  Description:
19754  This function reads the direction of the selected digital port.
19755  This function does not perform atomic register access.
19756  Precondition:
19757  None.
19758  Parameters:
19759  index - Identifier for the device instance to be configured
19760  channel - Identifier for the Ports channel A, B, C, etc.
19761  Returns:
19762  Direction of the selected port of type PORTS_DATA_MASK
19763  Example:
19764  <code>
19765 
19766  // Reads the direction of Port C pins
19767  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19768 
19769  </code>
19770  Remarks:
19771  This feature may not be available on all devices. Please refer to the
19772  specific device data sheet to determine availability or use
19773  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19774  this feature is available.
19775 */
19776 
19779  PORTS_MODULE_ID index ,
19780  PORTS_CHANNEL channel ) ;
19781 // *****************************************************************************
19782 /* Function:
19783  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19784  PORTS_DATA_MASK mask )
19785  Summary:
19786  Enables the open drain functionality for the selected port pins.
19787  Description:
19788  This function enables the open drain functionality for the selected port pins.
19789  This function does not perform atomic register access.
19790  Precondition:
19791  None.
19792  Parameters:
19793  index - Identifier for the device instance to be configured
19794  channel - Identifier for the Ports channel A, B, C, etc.
19795  mask - Identifies the pins for the open drain to be enabled
19796  Returns:
19797  None.
19798  Example:
19799  <code>
19800 
19801  // Enable Open Drain for RC0, RC1 and RC2 pins
19802  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19803 
19804  </code>
19805  Remarks:
19806  This feature may not be available on all devices. Please refer to the
19807  specific device data sheet to determine availability or use
19808  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19809  this feature is available.
19810 */
19811 
19812 void
19814  PORTS_MODULE_ID index ,
19815  PORTS_CHANNEL channel ,
19816  PORTS_DATA_MASK mask ) ;
19817 // *****************************************************************************
19818 /* Function:
19819  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19820  PORTS_DATA_MASK mask )
19821  Summary:
19822  Disables the open drain functionality for the selected port.
19823  Description:
19824  This function disables the open drain functionality for the selected port.
19825  This function does not perform atomic register access.
19826 
19827  Precondition:
19828  None.
19829  Parameters:
19830  index - Identifier for the device instance to be configured
19831  channel - Identifier for the Ports channel A, B, C, etc.
19832  mask - Identifies the pins for the open drain to be disabled
19833  Returns:
19834  None.
19835  Example:
19836  <code>
19837 
19838  // Disable Open Drain for RC0, RC1 and RC2 pins
19839  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19840 
19841  </code>
19842  Remarks:
19843  This feature may not be available on all devices. Please refer to the
19844  specific device data sheet to determine availability or use
19845  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19846  this feature is available.
19847 */
19848 
19849 void
19851  PORTS_MODULE_ID index ,
19852  PORTS_CHANNEL channel ,
19853  PORTS_DATA_MASK mask ) ;
19854 // *****************************************************************************
19855 /* Function:
19856  void PLIB_PORTS_ChannelModeSelect
19857  (
19858  PORTS_MODULE_ID index,
19859  PORTS_CHANNEL channel,
19860  PORTS_DATA_MASK modeMask,
19861  PORTS_PIN_MODE mode
19862  );
19863  Summary:
19864  Enables the selected channel pins as analog or digital.
19865  Description:
19866  This function enables the selected channel pins as analog or digital.
19867  This function does not perform atomic register access.
19868  Precondition:
19869  None.
19870  Parameters:
19871  index - Identifier for the device instance to be configured
19872  channel - Port pin channel
19873  modeMask - Identifies the pins whose mode has to be modified.
19874  Modes of the pins whose corresponding bit is '1' get
19875  modified, mode of the other pins remains the same.
19876  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19877  Returns:
19878  None.
19879  Example:
19880  <code>
19881 
19882  // Make pins RC5, RC8 and RC13 Analog
19883  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19884 
19885  </code>
19886  Remarks:
19887  This function is only available in devices with PPS. For Non-PPS devices, use the
19888  PLIB_PORTS_AnPinsModeSelect function.
19889 
19890  This feature may not be available on all devices. Please refer to the
19891  specific device data sheet to determine availability or use
19892  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19893  this feature is available.
19894 */
19895 
19896 void
19898  PORTS_MODULE_ID index ,
19899  PORTS_CHANNEL channel ,
19900  PORTS_DATA_MASK modeMask ,
19901  PORTS_PIN_MODE mode ) ;
19902 // *****************************************************************************
19903 /* Function:
19904  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19905  (
19906  PORTS_MODULE_ID index,
19907  PORTS_CHANNEL channel,
19908  PORTS_DATA_MASK mask
19909  );
19910  Summary:
19911  Enables Change Notice pull-up for the selected channel pins.
19912  Description:
19913  This function enables the Change Notice pull-up for the selected
19914  channel pins.
19915  This function does not perform atomic register access.
19916  Precondition:
19917  None.
19918  Parameters:
19919  index - Identifier for the device instance to be configured
19920  channel - Port pin channel
19921  mask - Identifies the pins of the pull-up to be enabled
19922  Returns:
19923  None.
19924  Example:
19925  <code>
19926 
19927  // Enable pull-up for RC5, RC8 and RC13 pins
19928  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19929  0x2120);
19930  </code>
19931  Remarks:
19932  This function is only available in devices with PPS. For Non-PPS devices, use the
19933  PLIB_PORTS_CnPinsPullUpEnable function.
19934 
19935  This feature may not be available on all devices. Please refer to the
19936  specific device data sheet to determine availability or use
19937  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19938  determine whether this feature is available.
19939 */
19940 
19941 void
19943  PORTS_MODULE_ID index ,
19944  PORTS_CHANNEL channel ,
19945  PORTS_DATA_MASK mask ) ;
19946 // *****************************************************************************
19947 /* Function:
19948  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19949  (
19950  PORTS_MODULE_ID index,
19951  PORTS_CHANNEL channel,
19952  PORTS_DATA_MASK mask
19953  );
19954  Summary:
19955  Disables Change Notice pull-up for the selected channel pins.
19956  Description:
19957  This function Disables the Change Notice pull-up for the selected
19958  channel pins.
19959  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19960  Precondition:
19961  None.
19962  Parameters:
19963  index - Identifier for the device instance to be configured
19964  channel - Port pin channel
19965  mask - Identifies the pins of the pull-up to be disabled
19966  Returns:
19967  None.
19968  Example:
19969  <code>
19970 
19971  // Disable pull-up for RC5, RC8 and RC13 pins
19972  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19973  0x2120);
19974  </code>
19975  Remarks:
19976  This function is only available in devices with PPS. For Non-PPS devices, use the
19977  PLIB_PORTS_CnPinsPullUpDisable function.
19978 
19979  This feature may not be available on all devices. Please refer to the
19980  specific device data sheet to determine availability or use
19981  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19982  determine whether this feature is available.
19983 */
19984 
19985 void
19987  PORTS_MODULE_ID index ,
19988  PORTS_CHANNEL channel ,
19989  PORTS_DATA_MASK mask ) ;
19990 // *****************************************************************************
19991 /* Function:
19992  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
19993  (
19994  PORTS_MODULE_ID index,
19995  PORTS_CHANNEL channel,
19996  PORTS_DATA_MASK mask
19997  );
19998  Summary:
19999  Enables Change Notice pull-down for the selected channel pins.
20000  Description:
20001  This function enables the Change Notice pull-down for the selected
20002  channel pins.
20003  This function does not perform atomic register access.
20004  Precondition:
20005  None.
20006  Parameters:
20007  index - Identifier for the device instance to be configured
20008  channel - Port pin channel
20009  mask - Identifies the pins for the pull-down to be enabled
20010  Returns:
20011  None.
20012  Example:
20013  <code>
20014 
20015  // Enable pull-down for RC5, RC8 and RC13 pins
20016  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20017  0x2120);
20018  </code>
20019  Remarks:
20020  This feature may not be available on all devices. Please refer to the
20021  specific device data sheet to determine availability or use
20022  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20023  determine whether this feature is available.
20024 */
20025 
20026 void
20028  PORTS_MODULE_ID index ,
20029  PORTS_CHANNEL channel ,
20030  PORTS_DATA_MASK mask ) ;
20031 // *****************************************************************************
20032 /* Function:
20033  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20034  (
20035  PORTS_MODULE_ID index,
20036  PORTS_CHANNEL channel,
20037  PORTS_DATA_MASK mask
20038  );
20039  Summary:
20040  Disables Change Notice pull-down for the selected channel pins.
20041  Description:
20042  This function Disables the Change Notice pull-down for the selected
20043  channel pins.
20044  This function does not perform atomic register access.
20045  Precondition:
20046  None.
20047  Parameters:
20048  index - Identifier for the device instance to be configured
20049  channel - Port pin channel
20050  mask - Identifies the pins for the pull-down to be disabled
20051  Returns:
20052  None.
20053  Example:
20054  <code>
20055 
20056  // Disable pull-down for RC5, RC8 and RC13 pins
20057  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20058  0x2120);
20059  </code>
20060  Remarks:
20061  This feature may not be available on all devices. Please refer to the
20062  specific device data sheet to determine availability or use
20063  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20064  determine whether this feature is available.
20065 */
20066 
20067 void
20069  PORTS_MODULE_ID index ,
20070  PORTS_CHANNEL channel ,
20071  PORTS_DATA_MASK mask ) ;
20072 // *****************************************************************************
20073 /* Function:
20074  void PLIB_PORTS_ChannelChangeNoticeEnable
20075  (
20076  PORTS_MODULE_ID index,
20077  PORTS_CHANNEL channel,
20078  PORTS_DATA_MASK mask
20079  );
20080  Summary:
20081  Enables CN interrupt for the selected pins of a channel.
20082  Description:
20083  This function enables Change Notice interrupt for the selected port
20084  pins of a channel.
20085  This function does not perform atomic register access.
20086  Precondition:
20087  None.
20088  Parameters:
20089  index - Identifier for the device instance to be configured
20090  channel - Port pin channel
20091  mask - Identifies the pins for which change notification is
20092  to be enabled
20093  Returns:
20094  None.
20095  Example:
20096  <code>
20097 
20098  // Enable CN interrupt for RC5, RC8 and RC13 pins
20099  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20100 
20101  </code>
20102  Remarks:
20103  This function is only available in devices with PPS. For Non-PPS devices, use the
20104  PLIB_PORTS_CnPinsEnable function.
20105 
20106  This feature may not be available on all devices. Please refer to the
20107  specific device data sheet to determine availability or use
20108  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20109  determine whether this feature is available.
20110 */
20111 
20112 void
20114  PORTS_MODULE_ID index ,
20115  PORTS_CHANNEL channel ,
20116  PORTS_DATA_MASK mask ) ;
20117 // *****************************************************************************
20118 /* Function:
20119  void PLIB_PORTS_ChannelChangeNoticeDisable
20120  (
20121  PORTS_MODULE_ID index,
20122  PORTS_CHANNEL channel,
20123  PORTS_DATA_MASK mask
20124  );
20125  Summary:
20126  Disables CN interrupt for the selected pins of a channel.
20127  Description:
20128  This function Disables Change Notice interrupt for the selected port
20129  pins of a channel.
20130  This function does not perform atomic register access.
20131  Precondition:
20132  None.
20133  Parameters:
20134  index - Identifier for the device instance to be configured
20135  channel - Port pin channel
20136  mask - Identifies the pins for which change notification is
20137  to be disabled
20138  Returns:
20139  None.
20140  Example:
20141  <code>
20142 
20143  // Disable CN interrupt for RC5, RC8 and RC13 pins
20144  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20145 
20146  </code>
20147  Remarks:
20148  This function is only available in devices with PPS. For Non-PPS devices, use the
20149  PLIB_PORTS_CnPinsDisable function.
20150 
20151  This feature may not be available on all devices. Please refer to the
20152  specific device data sheet to determine availability or use
20153  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20154  determine whether this feature is available.
20155 */
20156 
20157 void
20159  PORTS_MODULE_ID index ,
20160  PORTS_CHANNEL channel ,
20161  PORTS_DATA_MASK mask ) ;
20162 // *****************************************************************************
20163 /* Function:
20164  void PLIB_PORTS_AnPinsModeSelect
20165  (
20166  PORTS_MODULE_ID index,
20167  PORTS_AN_PIN anPins,
20168  PORTS_PIN_MODE mode
20169  );
20170  Summary:
20171  Enables the selected AN pins as analog or digital.
20172  Description:
20173  This function enables the selected AN pins as analog or digital.
20174  This function does not perform atomic register access.
20175  Precondition:
20176  None.
20177  Parameters:
20178  index - Identifier for the device instance to be configured
20179  anPins - AN pins whose mode is to be changed. Multiple AN pins
20180  can be ORed.
20181  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20182  Returns:
20183  None.
20184  Example:
20185  <code>
20186 
20187  // Make pins AN5, AN8 and AN13 Analog
20188  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20189  PORTS_AN_PIN_8 |
20190  PORTS_AN_PIN_13,
20191  PORTS_PIN_MODE_ANALOG);
20192 
20193  </code>
20194  Remarks:
20195  This function is only available in devices without PPS feature. For PPS
20196  devices, use the PLIB_PORTS_ChannelModeSelect function.
20197 
20198  This feature may not be available on all devices. Please refer to the
20199  specific device data sheet to determine availability or use
20200  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20201  this feature is available.
20202 */
20203 
20204 void
20206  PORTS_MODULE_ID index ,
20207  PORTS_AN_PIN anPins ,
20208  PORTS_PIN_MODE mode ) ;
20209 // *****************************************************************************
20210 /* Function:
20211  void PLIB_PORTS_CnPinsPullUpEnable
20212  (
20213  PORTS_MODULE_ID index,
20214  PORTS_CN_PIN cnPins
20215  );
20216  Summary:
20217  Enables Change Notice pull-up for the selected channel pins.
20218  Description:
20219  This function enables the Change Notice pull-up for the selected
20220  channel pins.
20221  This function performs atomic register access.
20222  Precondition:
20223  None.
20224  Parameters:
20225  index - Identifier for the device instance to be configured
20226  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20227  can be ORed.
20228  Returns:
20229  None.
20230  Example:
20231  <code>
20232 
20233  // Enable pull-up for CN5, CN8 and CN13 pins
20234  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20235  CHANGE_NOTICE_PIN_8 |
20236  CHANGE_NOTICE_PIN_13);
20237 
20238  </code>
20239  Remarks:
20240  This function is only available in devices without PPS feature. For PPS
20241  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20242 
20243  This feature may not be available on all devices. Please refer to the
20244  specific device data sheet to determine availability or use
20245  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20246  determine whether this feature is available.
20247 */
20248 
20249 void
20251  PORTS_MODULE_ID index ,
20252  PORTS_CN_PIN cnPins ) ;
20253 // *****************************************************************************
20254 /* Function:
20255  void PLIB_PORTS_CnPinsPullUpDisable
20256  (
20257  PORTS_MODULE_ID index,
20258  PORTS_CN_PIN cnPins
20259  );
20260  Summary:
20261  Disables Change Notice pull-up for the selected channel pins.
20262  Description:
20263  This function Disables the Change Notice pull-up for the selected
20264  channel pins.
20265  This function performs atomic register access.
20266  Precondition:
20267  None.
20268  Parameters:
20269  index - Identifier for the device instance to be configured
20270  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20271  can be ORed.
20272  Returns:
20273  None.
20274  Example:
20275  <code>
20276 
20277  // Disable pull-up for CN5, CN8 and CN13 pins
20278  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20279  CHANGE_NOTICE_PIN_5 |
20280  CHANGE_NOTICE_PIN_8 |
20281  CHANGE_NOTICE_PIN_13);
20282 
20283  </code>
20284  Remarks:
20285  This function is only available in devices without PPS feature. For PPS
20286  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20287 
20288  This feature may not be available on all devices. Please refer to the
20289  specific device data sheet to determine availability or use
20290  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20291  determine whether this feature is available.
20292 */
20293 
20294 void
20296  PORTS_MODULE_ID index ,
20297  PORTS_CN_PIN cnPins ) ;
20298 // *****************************************************************************
20299 /* Function:
20300  void PLIB_PORTS_CnPinsEnable
20301  (
20302  PORTS_MODULE_ID index,
20303  PORTS_CN_PIN cnPins
20304  );
20305  Summary:
20306  Enables CN interrupt for the selected pins of a channel.
20307  Description:
20308  This function enables Change Notice interrupt for the selected port
20309  pins of a channel.
20310  This function performs atomic register access.
20311  Precondition:
20312  None.
20313  Parameters:
20314  index - Identifier for the device instance to be configured
20315  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20316  Returns:
20317  None.
20318  Example:
20319  <code>
20320 
20321  // Enable CN interrupt for CN5, CN8 and CN13 pins
20322  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20323  CHANGE_NOTICE_PIN_5 |
20324  CHANGE_NOTICE_PIN_8 |
20325  CHANGE_NOTICE_PIN_13);
20326 
20327  </code>
20328  Remarks:
20329  This function is only available in devices without PPS feature. For PPS
20330  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20331 
20332  This feature may not be available on all devices. Please refer to the
20333  specific device data sheet to determine availability or use
20334  PLIB_PORTS_ExistsPinChangeNotice in your application to
20335  determine whether this feature is available.
20336 */
20337 
20338 void
20340  PORTS_MODULE_ID index ,
20341  PORTS_CN_PIN cnPins ) ;
20342 // *****************************************************************************
20343 /* Function:
20344  void PLIB_PORTS_CnPinsDisable
20345  (
20346  PORTS_MODULE_ID index,
20347  PORTS_CN_PIN cnPins
20348  );
20349  Summary:
20350  Disables CN interrupt for the selected pins of a channel.
20351  Description:
20352  This function Disables Change Notice interrupt for the selected port
20353  pins of a channel.
20354  This function performs atomic register access.
20355  Precondition:
20356  None.
20357  Parameters:
20358  index - Identifier for the device instance to be configured
20359  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20360  Returns:
20361  None.
20362  Example:
20363  <code>
20364 
20365  // Disable CN interrupt for CN5, CN8 and CN13 pins
20366  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20367  CHANGE_NOTICE_PIN_5 |
20368  CHANGE_NOTICE_PIN_8 |
20369  CHANGE_NOTICE_PIN_13);
20370 
20371  </code>
20372  Remarks:
20373  This function is only available in devices without PPS feature. For PPS
20374  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20375 
20376  This feature may not be available on all devices. Please refer to the
20377  specific device data sheet to determine availability or use
20378  PLIB_PORTS_ExistsPinChangeNotice in your application to
20379  determine whether this feature is available.
20380 */
20381 
20382 void
20384  PORTS_MODULE_ID index ,
20385  PORTS_CN_PIN cnPins ) ;
20386 // *****************************************************************************
20387 /* Function:
20388  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20389  Summary:
20390  Global Change Notice enable.
20391  Description:
20392  This function enables the global Change Notice feature.
20393  This function performs atomic register access.
20394  Precondition:
20395  None.
20396  Parameters:
20397  index - Identifier for the device instance to be configured
20398  Returns:
20399  None.
20400  Example:
20401  <code>
20402 
20403  // Enable Change Notification
20404  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20405 
20406  </code>
20407  Remarks:
20408  This function is only available in devices without PPS. For PPS devices, use the
20409  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20410 
20411  This feature may not be available on all devices. Please refer to the
20412  specific device data sheet to determine availability or use
20413  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20414  this feature is available.
20415 */
20416 
20417 void
20419  PORTS_MODULE_ID index ) ;
20420 // *****************************************************************************
20421 /* Function:
20422  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20423  Summary:
20424  Global Change Notice disable.
20425  Description:
20426  This function disables the global Change Notice feature.
20427  Precondition:
20428  None.
20429  Parameters:
20430  index - Identifier for the device instance to be configured
20431  Returns:
20432  None.
20433  Example:
20434  <code>
20435 
20436  // Disable Change Notification
20437  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20438 
20439  </code>
20440  Remarks:
20441  This function is only available in devices without PPS. For PPS devices, use the
20442  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20443 
20444  This feature may not be available on all devices. Please refer to the
20445  specific device data sheet to determine availability or use
20446  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20447  this feature is available.
20448 */
20449 
20450 void
20452  PORTS_MODULE_ID index ) ;
20453 // *****************************************************************************
20454 /* Function:
20455  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20456  PORTS_CHANGE_NOTICE_PIN pinNum )
20457  Summary:
20458  Port pin Change Notice interrupt enable.
20459  Description:
20460  This function enables the port pin Change Notice feature.
20461  This function performs atomic register access.
20462  Precondition:
20463  None.
20464  Parameters:
20465  index - Identifier for the device instance to be configured
20466  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20467  Returns:
20468  None.
20469  Example:
20470  <code>
20471 
20472  // Enable Change Notice interrupt for pin CN13
20473  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20474 
20475  </code>
20476  Remarks:
20477  This function is only available in devices without PPS. For PPS devices, use the
20478  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20479 
20480  This feature may not be available on all devices. Please refer to the
20481  specific device data sheet to determine availability or use
20482  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20483  this feature is available.
20484 */
20485 
20486 void
20488  PORTS_MODULE_ID index ,
20489  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20490 // *****************************************************************************
20491 /* Function:
20492  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20493  PORTS_CHANGE_NOTICE_PIN pinNum )
20494  Summary:
20495  Port pin Change Notice disable.
20496  Description:
20497  This function disables the port pin Change Notice feature.
20498  This function performs atomic register access.
20499  Precondition:
20500  None.
20501  Parameters:
20502  index - Identifier for the device instance to be configured
20503  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20504  Returns:
20505  None.
20506  Example:
20507  <code>
20508 
20509  // Disable Change Notice interrupt for pin CN13
20510  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20511 
20512  </code>
20513  Remarks:
20514  This function is only available in devices without PPS. For PPS devices, use the
20515  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20516 
20517  This feature may not be available on all devices. Please refer to the
20518  specific device data sheet to determine availability or use
20519  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20520  this feature is available.
20521 */
20522 
20523 void
20525  PORTS_MODULE_ID index ,
20526  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20527 // *****************************************************************************
20528 /* Function:
20529  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20530  Summary:
20531  CPU Idle mode does not affect Change Notice operation.
20532  Description:
20533  This function makes sure that Change Notice feature continues working in
20534  Idle mode.
20535  This function performs atomic register access.
20536 
20537  Precondition:
20538  None.
20539  Parameters:
20540  index - Identifier for the device instance to be configured
20541  Returns:
20542  None.
20543  Example:
20544  <code>
20545 
20546  // Change notification feature will be working even when CPU goes to
20547  // Idle mode
20548  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20549 
20550  </code>
20551  Remarks:
20552  This function is only available in devices without PPS. For PPS devices, use the
20553  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20554 
20555  This feature may not be available on all devices. Please refer to the
20556  specific device data sheet to determine availability or use
20557  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20558  this feature is available.
20559 */
20560 
20561 void
20563  PORTS_MODULE_ID index ) ;
20564 // *****************************************************************************
20565 /* Function:
20566  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20567  Summary:
20568  CPU Idle halts the Change Notice operation.
20569  Description:
20570  This function halts the Change Notice operation when the CPU enters
20571  Idle mode.
20572  This function performs atomic register access.
20573  Precondition:
20574  None.
20575  Parameters:
20576  index - Identifier for the device instance to be configured
20577  Returns:
20578  None.
20579  Example:
20580  <code>
20581  // Halts the Change notification operation when CPU enters Idle mode
20582  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20583 
20584  </code>
20585  Remarks:
20586  This function is only available in devices without PPS. For PPS devices, use the
20587  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20588 
20589  This feature may not be available on all devices. Please refer to the
20590  specific device data sheet to determine availability or use
20591  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20592  this feature is available.
20593 */
20594 
20595 void
20597  PORTS_MODULE_ID index ) ;
20598 // *****************************************************************************
20599 /* Function:
20600  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20601  PORTS_CHANGE_NOTICE_PIN pinNum )
20602  Summary:
20603  Enable pull-up on input change.
20604  Description:
20605  This function enables pull-up on selected input change notification pin.
20606  This function performs atomic register access.
20607  Precondition:
20608  None.
20609  Parameters:
20610  index - Identifier for the device instance to be configured
20611  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20612  Returns:
20613  None.
20614  Example:
20615  <code>
20616 
20617  // Enable pull-up on pin CN13
20618  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20619 
20620  </code>
20621  Remarks:
20622  This function is only available in devices without PPS. For PPS devices, use the
20623  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20624 
20625  This feature may not be available on all devices. Please refer to the
20626  specific device data sheet to determine availability or use
20627  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20628  this feature is available.
20629 */
20630 
20631 void
20633  PORTS_MODULE_ID index ,
20634  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20635 // *****************************************************************************
20636 /* Function:
20637  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20638  PORTS_CHANGE_NOTICE_PIN pinNum )
20639  Summary:
20640  Disable pull-up on input change.
20641  Description:
20642  This function disables pull-up on selected input change notification pin.
20643  This function performs atomic register access.
20644  Precondition:
20645  None.
20646  Parameters:
20647  index - Identifier for the device instance to be configured
20648  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20649  Returns:
20650  None.
20651  Example:
20652  <code>
20653 
20654  // Disable pull-up on pin CN13
20655  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20656 
20657  </code>
20658  Remarks:
20659  This function is only available in devices without PPS. For PPS devices, use the
20660  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20661 
20662  This feature may not be available on all devices. Please refer to the
20663  specific device data sheet to determine availability or use
20664  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20665  this feature is available.
20666 */
20667 
20668 void
20670  PORTS_MODULE_ID index ,
20671  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20672 // *****************************************************************************
20673 /* Function:
20674  void PLIB_PORTS_ChannelSlewRateSelect
20675  (
20676  PORTS_MODULE_ID index,
20677  PORTS_CHANNEL channel,
20678  PORTS_DATA_MASK channelMask,
20679  PORTS_PIN_SLEW_RATE slewRate
20680  );
20681  Summary:
20682  Selects the slew rate for selected channel pins.
20683  Description:
20684  This function selects the slew rate for selected channel pins.
20685  This function does not perform atomic register access.
20686  Precondition:
20687  None.
20688  Parameters:
20689  index - Identifier for the device instance to be configured
20690  channel - Port pin channel
20691  channelMask - Identifies the pins for which slew rate has to be modified.
20692  Slew rate of the pins which corresponding bit is "1" get
20693  modified, slew rate of the other pins remains the same.
20694  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20695  Returns:
20696  None.
20697  Example:
20698  <code>
20699 
20700  // Make slew rate of pins RC5, RC8 and RC13 slowest
20701  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20702  PORT_CHANNEL_C,
20703  0x2120,
20704  PORTS_PIN_SLEW_RATE_SLOWEST);
20705 
20706  </code>
20707  Remarks:
20708  This feature may not be available on all devices. Please refer to the
20709  specific device data sheet to determine availability or use
20710  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20711  whether this feature is available.
20712 */
20713 
20714 void
20716  PORTS_MODULE_ID index ,
20717  PORTS_CHANNEL channel ,
20718  PORTS_DATA_MASK channelMask ,
20719  PORTS_PIN_SLEW_RATE slewRate ) ;
20720 // *****************************************************************************
20721 /* Function:
20722 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20723  (
20724  PORTS_MODULE_ID index,
20725  PORTS_CHANNEL channel,
20726  PORTS_BIT_POS bitPos
20727  );
20728  Summary:
20729  Gets the slew rate for selected port pin.
20730  Description:
20731  This function gets the slew rate of selected port pin.
20732  This function does not perform atomic register access.
20733  Precondition:
20734  None.
20735  Parameters:
20736  index - Identifier for the device instance to be configured
20737  channel - Port pin channel
20738  bitPos - One of the possible values of PORTS_BIT_POS.
20739  Returns:
20740  One of the possible values of PORTS_PIN_SLEW_RATE.
20741  Example:
20742  <code>
20743  PORTS_PIN_SLEW_RATE slewRate;
20744 
20745  // Get the slew rate of pin RC1
20746  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20747 
20748  </code>
20749  Remarks:
20750  This feature may not be available on all devices. Please refer to the
20751  specific device data sheet to determine availability or use
20752  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20753  whether this feature is available.
20754 */
20755 
20756 PORTS_PIN_SLEW_RATE
20758  PORTS_MODULE_ID index ,
20759  PORTS_CHANNEL channel ,
20760  PORTS_BIT_POS bitPos ) ;
20761 // *****************************************************************************
20762 /* Function:
20763  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20764  (
20765  PORTS_MODULE_ID index,
20766  PORTS_CHANNEL channel,
20767  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20768  );
20769  Summary:
20770  Selects the Change Notice style for selected port channel.
20771  Description:
20772  This function selects the Change Notice style (or method) for selected port
20773  channel. It allows user to select whether the Change Notice detection will
20774  happen based on edge transition or level transition on all the CN pins of a
20775  particular channel.
20776  This function does not perform atomic register access.
20777  Precondition:
20778  None.
20779  Parameters:
20780  index - Identifier for the device instance to be configured
20781  channel - Port pin channel
20782  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20783  Returns:
20784  None.
20785  Example:
20786  <code>
20787  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20788  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20789  </code>
20790  Remarks:
20791  This feature may not be available on all devices. Please refer to the
20792  specific device data sheet to determine availability or use
20793  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20794  whether this feature is available.
20795 */
20796 
20797 void
20799  PORTS_MODULE_ID index ,
20800  PORTS_CHANNEL channel ,
20801  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20802 // *****************************************************************************
20803 /* Function:
20804  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20805  (
20806  PORTS_MODULE_ID index,
20807  PORTS_CHANNEL channel
20808  );
20809  Summary:
20810  Gets the Change Notice style for the selected port channel.
20811  Description:
20812  This function gets the Change Notice style (or method) for the selected port
20813  channel.
20814  This function does not perform atomic register access.
20815  Precondition:
20816  None.
20817  Parameters:
20818  index - Identifier for the device instance to be configured
20819  channel - Port pin channel
20820  Returns:
20821  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20822  Example:
20823  <code>
20824  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20825  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20826  </code>
20827  Remarks:
20828  This feature may not be available on all devices. Please refer to the
20829  specific device data sheet to determine availability or use
20830  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20831  whether this feature is available.
20832 */
20833 
20834 PORTS_CHANGE_NOTICE_METHOD
20836  PORTS_MODULE_ID index ,
20837  PORTS_CHANNEL channel ) ;
20838 // *****************************************************************************
20839 /* Function:
20840  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20841  (
20842  PORTS_MODULE_ID index,
20843  PORTS_CHANNEL channel,
20844  PORTS_DATA_MASK edgeRisingMask,
20845  PORTS_DATA_MASK edgeFallingMask
20846  );
20847  Summary:
20848  Enables selected type of edge for selected CN pins.
20849  Description:
20850  This function Enables selected type of edge (falling or rising) for
20851  selected CN pins of a port channel.
20852  This function does not perform atomic register access.
20853  Precondition:
20854  Change Notice method should be selected as
20855  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20856  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20857  Parameters:
20858  index - Identifier for the device instance to be configured
20859  channel - Port pin channel
20860  edgeRisingMask - Identifies the pins for which Change Notice has to be
20861  enabled for rising edge. Change Notice interrupt at rising
20862  edge is enabled for the pins which corresponding bit is
20863  '1', for the other pins it remains the same.
20864  edgeFallingMask - Identifies the pins for which Change Notice has to be
20865  enabled for falling edge. Change Notice interrupt at
20866  falling edge is enabled for the pins which corresponding
20867  bit is '1', for the other pins it remains the same.
20868  Returns:
20869  None.
20870  Example:
20871  <code>
20872  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20873  // RC1 & RC5 pins.
20874  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20875  </code>
20876  Remarks:
20877  This feature is not available on all devices. Please refer to the
20878  specific device data sheet to determine availability or use
20879  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20880  whether this feature is available.
20881 */
20882 
20883 void
20885  PORTS_MODULE_ID index ,
20886  PORTS_CHANNEL channel ,
20887  PORTS_DATA_MASK edgeRisingMask ,
20888  PORTS_DATA_MASK edgeFallingMask ) ;
20889 // *****************************************************************************
20890 /* Function:
20891  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20892  (
20893  PORTS_MODULE_ID index,
20894  PORTS_CHANNEL channel,
20895  PORTS_DATA_MASK edgeRisingMask,
20896  PORTS_DATA_MASK edgeFallingMask
20897  );
20898  Summary:
20899  Disables selected type of edge for selected CN pins.
20900  Description:
20901  This function Disables selected type of edge (falling or rising) for
20902  selected CN pins of a port channel.
20903  This function does not perform atomic register access.
20904  Precondition:
20905  Change Notice method should be selected as
20906  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20907  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20908  Parameters:
20909  index - Identifier for the device instance to be configured
20910  channel - Port pin channel
20911  edgeRisingMask - Identifies the pins for which Change Notice has to be
20912  enabled for rising edge. Change notice interrupt at rising
20913  edge is enabled for the pins which corresponding bit is
20914  '1', for the other pins it remains the same.
20915  edgeFallingMask - Identifies the pins for which Change Notice has to be
20916  enabled for falling edge. Change notice interrupt at
20917  falling edge is enabled for the pins which corresponding
20918  bit is '1', for the other pins it remains the same.
20919  Returns:
20920  None.
20921  Example:
20922  <code>
20923  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20924  // RC1 & RC5 pins.
20925  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20926  </code>
20927  Remarks:
20928  This feature is not available on all devices. Please refer to the
20929  specific device data sheet to determine availability or use
20930  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20931  whether this feature is available.
20932 */
20933 
20934 void
20936  PORTS_MODULE_ID index ,
20937  PORTS_CHANNEL channel ,
20938  PORTS_DATA_MASK edgeRisingMask ,
20939  PORTS_DATA_MASK edgeFallingMask ) ;
20940 // *****************************************************************************
20941 /* Function:
20942  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20943  (
20944  PORTS_MODULE_ID index,
20945  PORTS_CHANNEL channel,
20946  PORTS_BIT_POS bitPos,
20947  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20948  );
20949  Summary:
20950  Check if Change Notice edge is enabled or not.
20951  This function does not perform atomic register access.
20952  Description:
20953  This function checks if selected type of Change Notice edge is enabled on a
20954  particular port pin or not.
20955  This function does not perform atomic register access.
20956  Precondition:
20957  None.
20958  Parameters:
20959  index - Identifier for the device instance to be configured
20960  channel - Port pin channel
20961  bitPos - One of the possible values of PORTS_BIT_POS.
20962  cnEdgeType - Type of the edge which has to be checked.
20963 
20964  Returns:
20965  - true - Selected type of Change Notice Edge is enabled.
20966  - false - Selected type of Change Notice Edge is not enabled.
20967 
20968  Example:
20969  <code>
20970  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20971  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20972  {
20973  // do something
20974  }
20975  </code>
20976  Remarks:
20977  This feature is not available on all devices. Please refer to the
20978  specific device data sheet to determine availability or use
20979  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20980  whether this feature is available.
20981 */
20982 
20983 bool
20985  PORTS_MODULE_ID index ,
20986  PORTS_CHANNEL channel ,
20987  PORTS_BIT_POS bitPos ,
20988  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20989 // *****************************************************************************
20990 /* Function:
20991  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20992  (
20993  PORTS_MODULE_ID index,
20994  PORTS_CHANNEL channel,
20995  PORTS_BIT_POS bitPos
20996  );
20997  Summary:
20998  Check Change Notice edge status.
20999  Description:
21000  This function checks whether or no a Change Notice edge transition has occurred
21001  on the selected port pin.
21002  This function does not perform atomic register access.
21003  Precondition:
21004  None.
21005  Parameters:
21006  index - Identifier for the device instance to be configured
21007  channel - Port pin channel
21008  bitPos - One of the possible values of PORTS_BIT_POS
21009 
21010  Returns:
21011  - true - Change Notice edge transition has occurred
21012  - false - Change Notice edge transition has not occurred
21013 
21014  Example:
21015  <code>
21016  // Check if Change Notice edge transition has occurred for pin RC1.
21017  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21018  {
21019  // do something
21020  }
21021  </code>
21022  Remarks:
21023  This feature is not available on all devices. Please refer to the
21024  specific device data sheet to determine availability or use
21025  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21026  whether this feature is available.
21027 */
21028 
21029 bool
21031  PORTS_MODULE_ID index ,
21032  PORTS_CHANNEL channel ,
21033  PORTS_BIT_POS bitPos ) ;
21034 // *****************************************************************************
21035 // *****************************************************************************
21036 // Section: Ports Peripheral Library Exists Functions
21037 // *****************************************************************************
21038 // *****************************************************************************
21039 /* The functions below indicate the existence of the features on the device.
21040 */
21041 //******************************************************************************
21042 /* Function:
21043  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21044  Summary:
21045  Identifies whether the RemapInput feature exists on the Ports module.
21046  Description:
21047  This function identifies whether the RemapInput feature is available on the
21048  Ports module.
21049  When this function returns true, this function is supported on the device:
21050  - PLIB_PORTS_RemapInput
21051  Preconditions:
21052  None.
21053  Parameters:
21054  index - Identifier for the device instance
21055  Returns:
21056  - true - The RemapInput feature is supported on the device
21057  - false - The RemapInput feature is not supported on the device
21058  Remarks:
21059  None.
21060 */
21061 
21062 bool
21064  PORTS_MODULE_ID index ) ;
21065 //******************************************************************************
21066 /* Function:
21067  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21068  Summary:
21069  Identifies whether the RemapOutput feature exists on the Ports module.
21070  Description:
21071  This function identifies whether the RemapOutput feature is available on the
21072  Ports module.
21073  When this function returns true, this function is supported on the device:
21074  - PLIB_PORTS_RemapOutput
21075  Preconditions:
21076  None.
21077  Parameters:
21078  index - Identifier for the device instance
21079  Returns:
21080  - true - The RemapOutput feature is supported on the device
21081  - false - The RemapOutput feature is not supported on the device
21082  Remarks:
21083  None.
21084 */
21085 
21086 bool
21088  PORTS_MODULE_ID index ) ;
21089 //******************************************************************************
21090 /* Function:
21091  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21092  Summary:
21093  Identifies whether the PinMode feature exists on the Ports module.
21094  Description:
21095  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21096  feature is available on the Ports module.
21097  When this function returns true, this function is supported on the device:
21098  - PLIB_PORTS_PinModeSelect
21099  Preconditions:
21100  None.
21101  Parameters:
21102  index - Identifier for the device instance
21103  Returns:
21104  - true - The PinMode feature is supported on the device
21105  - false - The PinMode feature is not supported on the device
21106  Remarks:
21107  None.
21108 */
21109 
21110 bool
21112  PORTS_MODULE_ID index ) ;
21113 //******************************************************************************
21114 /* Function:
21115  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21116  Summary:
21117  Identifies whether the AnPinsMode feature exists on the Ports module.
21118  Description:
21119  This function identifies whether the AnPinsMode feature is available on the
21120  Ports module.
21121  When this function returns true, this function is supported on the device:
21122  - PLIB_PORTS_AnPinsModeSelect
21123  Preconditions:
21124  None.
21125  Parameters:
21126  index - Identifier for the device instance
21127  Returns:
21128  - true - The AnPinsMode feature is supported on the device
21129  - false - The AnPinsMode feature is not supported on the device
21130  Remarks:
21131  None.
21132 */
21133 
21134 bool
21136  PORTS_MODULE_ID index ) ;
21137 //******************************************************************************
21138 /* Function:
21139  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21140  Summary:
21141  Identifies whether the PortsRead feature exists on the Ports module.
21142  Description:
21143  This function identifies whether the PortsRead feature is available on the
21144  Ports module.
21145  When this function returns true, these functions are supported on the device:
21146  - PLIB_PORTS_PinGet
21147  - PLIB_PORTS_Read
21148  Preconditions:
21149  None.
21150  Parameters:
21151  index - Identifier for the device instance
21152  Returns:
21153  - true - The PortsRead feature is supported on the device
21154  - false - The PortsRead feature is not supported on the device
21155  Remarks:
21156  None.
21157 */
21158 
21159 bool
21161  PORTS_MODULE_ID index ) ;
21162 //******************************************************************************
21163 /* Function:
21164  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21165  Summary:
21166  Identifies whether the LatchRead feature exists on the Ports module.
21167  Description:
21168  This function identifies whether the LatchRead feature is available on the
21169  Ports module.
21170  When this function returns true, these functions are supported on the device:
21171  - PLIB_PORTS_PinGetLatched
21172  - PLIB_PORTS_ReadLatched
21173  Preconditions:
21174  None.
21175  Parameters:
21176  index - Identifier for the device instance
21177  Returns:
21178  - true - The LatchRead feature is supported on the device
21179  - false - The LatchRead feature is not supported on the device
21180  Remarks:
21181  None.
21182 */
21183 
21184 bool
21186  PORTS_MODULE_ID index ) ;
21187 //******************************************************************************
21188 /* Function:
21189  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21190  Summary:
21191  Identifies whether the PortsWrite feature exists on the Ports module.
21192  Description:
21193  This function identifies whether the PortsWrite feature is available on the
21194  Ports module.
21195  When this function returns true, these functions are supported on the device:
21196  - PLIB_PORTS_PinWrite
21197  - PLIB_PORTS_PinSet
21198  - PLIB_PORTS_PinClear
21199  - PLIB_PORTS_PinToggle
21200  - PLIB_PORTS_Write
21201  - PLIB_PORTS_Set
21202  - PLIB_PORTS_Toggle
21203  - PLIB_PORTS_Clear
21204  Preconditions:
21205  None.
21206  Parameters:
21207  index - Identifier for the device instance
21208  Returns:
21209  - true - The PortsWrite feature is supported on the device
21210  - false - The PortsWrite feature is not supported on the device
21211  Remarks:
21212  None.
21213 */
21214 
21215 bool
21217  PORTS_MODULE_ID index ) ;
21218 //******************************************************************************
21219 /* Function:
21220  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21221  Summary:
21222  Identifies whether the PortsDirection feature exists on the Ports module.
21223  Description:
21224  This function identifies whether the PortsDirection feature is available on the
21225  Ports module.
21226  When this function returns true, these functions are supported on the device:
21227  - PLIB_PORTS_PinDirectionInputSet
21228  - PLIB_PORTS_PinDirectionOutputSet
21229  - PLIB_PORTS_DirectionInputSet
21230  - PLIB_PORTS_DirectionOutputSet
21231  - PLIB_PORTS_DirectionGet
21232  Preconditions:
21233  None.
21234  Parameters:
21235  index - Identifier for the device instance
21236  Returns:
21237  - true - The PortsDirection feature is supported on the device
21238  - false - The PortsDirection feature is not supported on the device
21239  Remarks:
21240  None.
21241 */
21242 
21243 bool
21245  PORTS_MODULE_ID index ) ;
21246 //******************************************************************************
21247 /* Function:
21248  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21249  Summary:
21250  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21251  Description:
21252  This function identifies whether the PortsOpenDrain feature is available on
21253  the Ports module.
21254  When this function returns true, these functions are supported on the device:
21255  - PLIB_PORTS_PinOpenDrainEnable
21256  - PLIB_PORTS_PinOpenDrainDisable
21257  - PLIB_PORTS_OpenDrainEnable
21258  - PLIB_PORTS_OpenDrainDisable
21259  Preconditions:
21260  None.
21261  Parameters:
21262  index - Identifier for the device instance
21263  Returns:
21264  - true - The PortsOpenDrain feature is supported on the device
21265  - false - The PortsOpenDrain feature is not supported on the device
21266  Remarks:
21267  None.
21268 */
21269 
21270 bool
21272  PORTS_MODULE_ID index ) ;
21273 //******************************************************************************
21274 /* Function:
21275  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21276  Summary:
21277  Identifies whether the ChangeNotice feature exists on the Ports module.
21278  Description:
21279  This function identifies whether the ChangeNotice feature is available on the
21280  Ports module.
21281  When this function returns true, these functions are supported on the device:
21282  - PLIB_PORTS_ChangeNoticeEnable
21283  - PLIB_PORTS_ChangeNoticeDisable
21284  Preconditions:
21285  None.
21286  Parameters:
21287  index - Identifier for the device instance
21288  Returns:
21289  - true - The ChangeNotice feature is supported on the device
21290  - false - The ChangeNotice feature is not supported on the device
21291  Remarks:
21292  None.
21293 */
21294 
21295 bool
21297  PORTS_MODULE_ID index ) ;
21298 //******************************************************************************
21299 /* Function:
21300  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21301  Summary:
21302  Identifies whether the PinChangeNotice feature exists on the Ports module.
21303  Description:
21304  This function identifies whether the PinChangeNotice feature is available on
21305  the Ports module.
21306  When this function returns true, these functions are supported on the device:
21307  - PLIB_PORTS_PinChangeNoticeEnable
21308  - PLIB_PORTS_PinChangeNoticeDisable
21309  - PLIB_PORTS_CnPinsEnable
21310  - PLIB_PORTS_CnPinsDisable
21311  Preconditions:
21312  None.
21313  Parameters:
21314  index - Identifier for the device instance
21315  Returns:
21316  - true - The PinChangeNotice feature is supported on the device
21317  - false - The PinChangeNotice feature is not supported on the device
21318  Remarks:
21319  None.
21320 */
21321 
21322 bool
21324  PORTS_MODULE_ID index ) ;
21325 //******************************************************************************
21326 /* Function:
21327  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21328  Summary:
21329  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21330  Description:
21331  This function identifies whether the ChangeNoticeInIdle feature is available
21332  on the Ports module.
21333  When this function returns true, these functions are supported on the device:
21334  - PLIB_PORTS_ChangeNoticeInIdleEnable
21335  - PLIB_PORTS_ChangeNoticeInIdleDisable
21336  Preconditions:
21337  None.
21338  Parameters:
21339  index - Identifier for the device instance
21340  Returns:
21341  - true - The ChangeNoticeInIdle feature is supported on the device
21342  - false - The ChangeNoticeInIdle feature is not supported on the device
21343  Remarks:
21344  None.
21345 */
21346 
21347 bool
21349  PORTS_MODULE_ID index ) ;
21350 //******************************************************************************
21351 /* Function:
21352  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21353  Summary:
21354  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21355  Description:
21356  This function identifies whether the ChangeNoticePullup feature is available
21357  on the Ports module.
21358  When this function returns true, these functions are supported on the device:
21359  - PLIB_PORTS_ChangeNoticePullUpEnable
21360  - PLIB_PORTS_ChangeNoticePullUpDisable
21361  - PLIB_PORTS_CnPinsPullUpEnable
21362  - PLIB_PORTS_CnPinsPullUpDisable
21363  Preconditions:
21364  None.
21365  Parameters:
21366  index - Identifier for the device instance
21367  Returns:
21368  - true - The ChangeNoticePullup feature is supported on the device
21369  - false - The ChangeNoticePullup feature is not supported on the device
21370  Remarks:
21371  None.
21372 */
21373 
21374 bool
21376  PORTS_MODULE_ID index ) ;
21377 //******************************************************************************
21378 /* Function:
21379  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21380  Summary:
21381  Identifies whether the PinModePerPort feature exists on the Ports module.
21382  Description:
21383  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21384  feature is available on the Ports module.
21385  When this function returns true, these functions are supported on the device:
21386  - PLIB_PORTS_PinModePerPortSelect
21387  - PLIB_PORTS_ChannelModeSelect
21388  Preconditions:
21389  None.
21390  Parameters:
21391  index - Identifier for the device instance
21392  Returns:
21393  - true - The PinModePerPort feature is supported on the device
21394  - false - The PinModePerPort feature is not supported on the device
21395  Remarks:
21396  None.
21397 */
21398 
21399 bool
21401  PORTS_MODULE_ID index ) ;
21402 //******************************************************************************
21403 /* Function:
21404  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21405  Summary:
21406  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21407  Ports module.
21408  Description:
21409  This function identifies whether the ChangeNoticePullDownPerPort feature is
21410  available on the Ports module.
21411  When this function returns true, these functions are supported on the device:
21412  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21413  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21414  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21415  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21416  Preconditions:
21417  None.
21418  Parameters:
21419  index - Identifier for the device instance
21420  Returns:
21421  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21422  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21423  Remarks:
21424  None.
21425 */
21426 
21427 bool
21429  PORTS_MODULE_ID index ) ;
21430 //******************************************************************************
21431 /* Function:
21432  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21433  Summary:
21434  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21435  module.
21436  Description:
21437  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21438  on the Ports module.
21439  When this function returns true, these functions are supported on the device:
21440  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21441  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21442  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21443  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21444  Preconditions:
21445  None.
21446  Parameters:
21447  index - Identifier for the device instance
21448  Returns:
21449  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21450  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21451  Remarks:
21452  None.
21453 */
21454 
21455 bool
21457  PORTS_MODULE_ID index ) ;
21458 //******************************************************************************
21459 /* Function:
21460  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21461  Summary:
21462  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21463  module.
21464  Description:
21465  This function identifies whether the PinChangeNoticePerPort feature is
21466  available on the Ports module.
21467  When this function returns true, these functions are supported on the device:
21468  - PLIB_PORTS_PinChangeNoticePerPortEnable
21469  - PLIB_PORTS_PinChangeNoticePerPortDisable
21470  - PLIB_PORTS_ChannelChangeNoticeEnable
21471  - PLIB_PORTS_ChannelChangeNoticeDisable
21472  Preconditions:
21473  None.
21474  Parameters:
21475  index - Identifier for the device instance
21476  Returns:
21477  - true - The PinChangeNoticePerPort feature is supported on the device
21478  - false - The PinChangeNoticePerPort feature is not supported on the device
21479  Remarks:
21480  None.
21481 */
21482 
21483 bool
21485  PORTS_MODULE_ID index ) ;
21486 //******************************************************************************
21487 /* Function:
21488  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21489  Summary:
21490  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21491  module.
21492  Description:
21493  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21494  available on the Ports module.
21495  When this function returns true, these functions are supported on the device:
21496  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21497  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21498  Preconditions:
21499  None.
21500  Parameters:
21501  index - Identifier for the device instance
21502  Returns:
21503  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21504  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21505  Remarks:
21506  None.
21507 */
21508 
21509 bool
21511  PORTS_MODULE_ID index ) ;
21512 //******************************************************************************
21513 /* Function:
21514  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21515  Summary:
21516  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21517  module.
21518  Description:
21519  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21520  available on the Ports module.
21521  When this function returns true, these functions are supported on the device:
21522  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21523  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21524  Preconditions:
21525  None.
21526  Parameters:
21527  index - Identifier for the device instance
21528  Returns:
21529  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21530  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21531  Remarks:
21532  None.
21533 */
21534 
21535 bool
21537  PORTS_MODULE_ID index ) ;
21538 //******************************************************************************
21539 /* Function:
21540  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21541  Summary:
21542  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21543  module.
21544  Description:
21545  This function identifies whether the ChangeNoticePerPortStatus feature is
21546  available on the Ports module.
21547  When this function returns true, these functions are supported on the device:
21548  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21549  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21550  Preconditions:
21551  None.
21552  Parameters:
21553  index - Identifier for the device instance
21554  Returns:
21555  - true - The ChangeNoticePerPortStatus feature is supported on the device
21556  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21557  Remarks:
21558  None.
21559 */
21560 
21561 bool
21563  PORTS_MODULE_ID index ) ;
21564 //******************************************************************************
21565 /* Function:
21566  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21567  Summary:
21568  Identifies whether the SlewRateControl feature exists on the Ports module.
21569  Description:
21570  This function identifies whether the SlewRateControl feature is available
21571  on the Ports module.
21572  When this function returns true, these functions are supported on the device:
21573  - PLIB_PORTS_ChannelSlewRateSelect
21574  - PLIB_PORTS_PinSlewRateGet
21575  Preconditions:
21576  None.
21577  Parameters:
21578  index - Identifier for the device instance
21579  Returns:
21580  - true - The SlewRateControl feature is supported on the device
21581  - false - The SlewRateControl feature is not supported on the device
21582  Remarks:
21583  None.
21584 */
21585 
21586 bool
21588  PORTS_MODULE_ID index ) ;
21589 //******************************************************************************
21590 /* Function:
21591  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21592  Summary:
21593  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21594  Ports module.
21595  Description:
21596  This function identifies whether the ChannelChangeNoticeMethod feature is
21597  available on the Ports module.
21598  When this function returns true, these functions are supported on the device:
21599  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21600  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21601  Preconditions:
21602  None.
21603  Parameters:
21604  index - Identifier for the device instance
21605  Returns:
21606  - true - The ChannelChangeNoticeMethod feature is supported on the device
21607  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21608  Remarks:
21609  None.
21610 */
21611 
21612 bool
21614  PORTS_MODULE_ID index ) ;
21615 //******************************************************************************
21616 /* Function:
21617  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21618  Summary:
21619  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21620  module.
21621  Description:
21622  This function identifies whether the ChangeNoticeEdgeControl feature is
21623  available on the Ports module.
21624  When this function returns true, these functions are supported on the device:
21625  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21626  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21627  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21628  Preconditions:
21629  None.
21630  Parameters:
21631  index - Identifier for the device instance
21632  Returns:
21633  - true - The ChangeNoticeEdgeControl feature is supported on the device
21634  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21635  Remarks:
21636  None.
21637 */
21638 
21639 bool
21641  PORTS_MODULE_ID index ) ;
21642 //******************************************************************************
21643 /* Function:
21644  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21645  Summary:
21646  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21647  module.
21648  Description:
21649  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21650  on the Ports module.
21651  When this function returns true, this function is supported on the device:
21652  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21653  Preconditions:
21654  None.
21655  Parameters:
21656  index - Identifier for the device instance
21657  Returns:
21658  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21659  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21660  Remarks:
21661  None.
21662 */
21663 
21664 bool
21666  PORTS_MODULE_ID index ) ;
21667 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21668 /*******************************************************************************
21669  Ports Peripheral Library Compatibility Header
21670  Company:
21671  Microchip Technology Inc.
21672  File Name:
21673  plib_ports_compatibility.h
21674  Summary:
21675  Ports Peripheral Library Interface header for backward compatibility.
21676  Description:
21677  This header file contains the definitions of the functions which are
21678  supported for backward compatibility only. These will be deprecated later.
21679 *******************************************************************************/
21680 // DOM-IGNORE-BEGIN
21681 /*******************************************************************************
21682 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21683 Microchip licenses to you the right to use, modify, copy and distribute
21684 Software only when embedded on a Microchip microcontroller or digital signal
21685 controller that is integrated into your product or third party product
21686 (pursuant to the sublicense terms in the accompanying license agreement).
21687 You should refer to the license agreement accompanying this Software for
21688 additional information regarding your rights and obligations.
21689 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21690 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21691 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21692 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21693 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21694 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21695 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21696 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21697 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21698 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21699 *******************************************************************************/
21700 // DOM-IGNORE-END
21701 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21702 #define _PLIB_PORTS_COMPATIBILITY_H
21703 #include <stdint.h>
21704 #include <stddef.h>
21705 // *****************************************************************************
21706 /* Function:
21707  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21708  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21709  Summary:
21710  checks the status of change on the pin
21711  Description:
21712  This function checks if the change has occurred on the given pin or not.
21713  Precondition:
21714  None.
21715  Parameters:
21716  index - Identifier for the device instance to be configured
21717  channel - Port pin channel
21718  bitPos - Position in the PORT pins
21719  Returns:
21720  None.
21721  Example:
21722  <code>
21723 
21724  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21725  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21726  {
21727  //do something
21728  }
21729 
21730  </code>
21731  Remarks:
21732  This feature may not be available on all devices. Please refer to the
21733  specific device data sheet to determine availability or use
21734  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21735  whether this feature is available.
21736 
21737  This function will be deprecated later.
21738 */
21739 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21740  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21741 /*******************************************************************************
21742  End of File
21743 */
21744 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21745 /* CLOSE_FILE Include File */
21746 
21747 //DOM-IGNORE-BEGIN
21748 //DOM-IGNORE-END
21749  // #ifndef _PLIB_PORTS_H
21750 /*******************************************************************************
21751  End of File
21752 */
21753 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21754 /* CLOSE_FILE Include File */
21755 
21756 #include "system/int/sys_int.h"
21757 // *****************************************************************************
21758 // *****************************************************************************
21759 // Section: SYS PORTS Data Types
21760 // *****************************************************************************
21761 // *****************************************************************************
21762 // *****************************************************************************
21763 /* SYS PORTS PULLUP status
21764  Summary:
21765  Provides the pull-up and pull-down status.
21766  Description:
21767  These constants provide the pull-up or pull-down status definitions.
21768  Remarks:
21769  None.
21770 */
21771 
21772 typedef
21773  enum
21774  {
21775  /* PULLUP Disable */
21777  /*DOM-IGNORE-BEGIN*/
21778  = 0 /*DOM-IGNORE-END*/
21779  ,
21780  /* PULLUP Enable */
21782  /*DOM-IGNORE-BEGIN*/
21783  = 1 /*DOM-IGNORE-END*/
21784  ,
21786 // *****************************************************************************
21787 /* SYS PORTS PIN DIRECTION
21788  Summary:
21789  Defines the direction of the port pins.
21790  Description:
21791  These constants provide the port pin direction definitions.
21792  Remarks:
21793  None.
21794 */
21795 
21796 typedef
21797  enum
21798  {
21799  /* Direction as output */
21801  /*DOM-IGNORE-BEGIN*/
21802  = 0 /*DOM-IGNORE-END*/
21803  ,
21804  /* Direction as input */
21806  /*DOM-IGNORE-BEGIN*/
21807  = 1 /*DOM-IGNORE-END*/
21808  ,
21810 
21811 typedef
21812  enum
21813  {
21816  // #ifndef _SYS_PORTS_DEFINITIONS_H
21817 /*******************************************************************************
21818  End of File
21819 */
21820 
21821 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21822 /* CLOSE_FILE Include File */
21823 
21824 // DOM-IGNORE-BEGIN
21825 // DOM-IGNORE-END
21826 // *****************************************************************************
21827 // *****************************************************************************
21828 // Section: SYS PorTS Module Initialization Routine
21829 // *****************************************************************************
21830 // *****************************************************************************
21831 // *****************************************************************************
21832 /* Function:
21833  void SYS_PORTS_Initialize()
21834  Summary:
21835  Initializes PORT Pins/Channels.
21836  <p><b>Implementation:</b> Static/Dynamic</p>
21837  Description:
21838  This function initializes different port pins/channels to the desired state.
21839  It also remaps the pins to the desired specific function.
21840  Precondition:
21841  None.
21842  Parameters:
21843  None.
21844  Returns:
21845  None.
21846  Example:
21847  <code>
21848  SYS_PORTS_Initialize();
21849  </code>
21850  Remarks:
21851  This API must be be called at the time of system initialization to
21852  initialize the ports pins.
21853 */
21854 
21855 void
21857 // *****************************************************************************
21858 // *****************************************************************************
21859 // Section: SYS PORTS CONTROL Routines
21860 // *****************************************************************************
21861 // *****************************************************************************
21862 // *****************************************************************************
21863 /* Function:
21864  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21865  Summary:
21866  Reads the data from the I/O port.
21867  <p><b>Implementation:</b> Dynamic</p>
21868  Description:
21869  This function reads the data from the I/O port.
21870  Preconditions:
21871  The direction of the port to be set as input.
21872  Parameters:
21873  index - Identifier for the device instance to be configured
21874  channel - Identifier for the PORT channel: A, B, C, etc.
21875  Returns:
21876  Returns the data read from the port.
21877  Example:
21878  <code>
21879  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21880  // application developer.
21881  PORTS_DATA_TYPE readData;
21882  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21883  </code>
21884  Remarks:
21885  None.
21886 */
21887 
21889  SYS_PORTS_Read (
21890  PORTS_MODULE_ID index ,
21891  PORTS_CHANNEL channel ) ;
21892 // *****************************************************************************
21893 /* Function:
21894  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21895  PORTS_CHANNEL channel,
21896  PORTS_DATA_TYPE value )
21897  Summary:
21898  Writes the data to the I/O port.
21899  <p><b>Implementation:</b> Dynamic</p>
21900  Description:
21901  This function writes the data to the I/O port.
21902  Preconditions:
21903  The direction of the port to be set as output.
21904  Parameters:
21905  index - Identifier for the device instance to be configured
21906  channel - Identifier for the PORT channel: A, B, C, etc.
21907  value - Value to be written into a port of width PORTS_DATA_TYPE
21908  Returns:
21909  None.
21910  Example:
21911  <code>
21912  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21913  // application developer.
21914  PORTS_DATA_TYPE writeData;
21915  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21916  </code>
21917  Remarks:
21918  None.
21919 */
21920 
21921 void
21922  SYS_PORTS_Write (
21923  PORTS_MODULE_ID index ,
21924  PORTS_CHANNEL channel ,
21925  PORTS_DATA_TYPE value ) ;
21926 // *****************************************************************************
21927 /* Function:
21928  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21929  Summary:
21930  Reads the data driven on the I/O port.
21931  <p><b>Implementation:</b> Dynamic</p>
21932  Description:
21933  This function reads the data driven on the I/O port.
21934  Preconditions:
21935  The direction of the port to be set as output.
21936  Parameters:
21937  index - Identifier for the device instance to be configured
21938  channel - Identifier for the PORT channel: A, B, C, etc.
21939  Returns:
21940  Returns the data driven on the port.
21941  Example:
21942  <code>
21943  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21944  // application developer.
21945  PORTS_DATA_TYPE drivenData;
21946  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21947  </code>
21948  Remarks:
21949  None.
21950 */
21951 
21954  PORTS_MODULE_ID index ,
21955  PORTS_CHANNEL channel ) ;
21956 // *****************************************************************************
21957 /* Function:
21958  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21959  PORTS_DATA_TYPE value,
21960  PORTS_DATA_MASK mask )
21961  Summary:
21962  Sets the selected digital port/latch based on the mask.
21963  <p><b>Implementation:</b> Dynamic</p>
21964  Description:
21965  This function Sets the selected digital port/latch relative to the mask.
21966  This function "AND" value and mask parameters and then set the bits
21967  in the port channel that were set in the result of the ANDing operation.
21968  Preconditions:
21969  None.
21970  Parameters:
21971  index - Identifier for the device instance to be configured
21972  channel - Identifier for the PORT channel: A, B, C, etc.
21973  value - Consists of information about which port bit has to be set
21974  mask - Identifies the bits which could be intended for setting
21975  Returns:
21976  None.
21977  Example:
21978  <code>
21979  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21980  // application developer.
21981  // MY_VALUE - 0x1234
21982  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21983  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21984  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21985  </code>
21986  Remarks:
21987  Not all features are available on all devices. Refer to the specific device
21988  data sheet for availability.
21989 */
21990 
21991 void
21992  SYS_PORTS_Set (
21993  PORTS_MODULE_ID index ,
21994  PORTS_CHANNEL channel ,
21995  PORTS_DATA_TYPE value ,
21996  PORTS_DATA_MASK mask ) ;
21997 // *****************************************************************************
21998 /* Function:
21999  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22000  PORTS_DATA_MASK clearMask )
22001  Summary:
22002  Clears the selected digital port.
22003  <p><b>Implementation:</b> Dynamic</p>
22004  Description:
22005  This function clears the selected digital port.
22006  Preconditions:
22007  None.
22008  Parameters:
22009  index - Identifier for the device instance to be configured
22010  channel - Identifier for the PORT channel: A, B, C, etc.
22011  clearMask - Identifies the bits to be cleared
22012  Returns:
22013  None.
22014  Example:
22015  <code>
22016  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22017  // application developer.
22018  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22019  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22020  </code>
22021  Remarks:
22022  Not all features are available on all devices. Refer to the specific device
22023  data sheet for availability.
22024 */
22025 
22026 void
22027  SYS_PORTS_Clear (
22028  PORTS_MODULE_ID index ,
22029  PORTS_CHANNEL channel ,
22030  PORTS_DATA_MASK clearMask ) ;
22031 // *****************************************************************************
22032 /* Function:
22033  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22034  SYS_PORTS_PIN_DIRECTION pinDir,
22035  PORTS_CHANNEL channel,
22036  PORTS_DATA_MASK mask )
22037  Summary:
22038  Enables the direction for the selected port.
22039  <p><b>Implementation:</b> Dynamic</p>
22040  Description:
22041  This function enables the direction for the selected port.
22042  Preconditions:
22043  None.
22044  Parameters:
22045  index - Identifier for the device instance to be configured
22046  pinDir - Pin direction
22047  channel - Identifier for the PORT channel: A, B, C, etc.
22048  mask - Mask for the direction of width PORTS_DATA_MASK
22049  Returns:
22050  None
22051  Example:
22052  <code>
22053  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22054  // application developer.
22055  SYS_PORTS_PIN_DIRECTION pinDir;
22056  pinDir = SYS_PORTS_DIRECTION_INPUT;
22057  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22058  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22059  </code>
22060  Remarks:
22061  None.
22062 */
22063 
22064 void
22066  PORTS_MODULE_ID index ,
22067  SYS_PORTS_PIN_DIRECTION pinDir ,
22068  PORTS_CHANNEL channel ,
22069  PORTS_DATA_MASK mask ) ;
22070 // *****************************************************************************
22071 /* Function:
22072  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22073  Summary:
22074  Reads the direction for the selected port.
22075  <p><b>Implementation:</b> Dynamic</p>
22076  Description:
22077  This function reads the direction for the selected port.
22078  Preconditions:
22079  None.
22080  Parameters:
22081  index - Identifier for the device instance to be configured
22082  channel - Identifier for the PORT channel: A, B, C, etc.
22083  Returns:
22084  Direction of the port.
22085  Example:
22086  <code>
22087  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22088  // application developer.
22089  PORTS_DATA_MASK value;
22090  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22091  </code>
22092  Remarks:
22093  None.
22094 */
22095 
22098  PORTS_MODULE_ID index ,
22099  PORTS_CHANNEL channel ) ;
22100 // *****************************************************************************
22101 /* Function:
22102  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22103  PORTS_DATA_MASK toggleMask )
22104  Summary:
22105  Toggles the selected digital port pins.
22106  <p><b>Implementation:</b> Dynamic</p>
22107  Description:
22108  This function toggles the selected digital port pins.
22109  Preconditions:
22110  None.
22111  Parameters:
22112  index - Identifier for the device instance to be configured
22113  channel - Identifier for the PORT channel: A, B, C, etc.
22114  toggleMask - Identifies the bits to be toggled
22115  Returns:
22116  None.
22117  Example:
22118  <code>
22119  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22120  // application developer.
22121  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22122  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22123  </code>
22124  Remarks:
22125  None.
22126 */
22127 
22128 void
22130  PORTS_MODULE_ID index ,
22131  PORTS_CHANNEL channel ,
22132  PORTS_DATA_MASK toggleMask ) ;
22133 // *****************************************************************************
22134 /* Function:
22135  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22136  PORTS_DATA_MASK mask )
22137  Summary:
22138  Enables the open-drain functionality for the selected port.
22139  <p><b>Implementation:</b> Dynamic</p>
22140  Description:
22141  This function enables the open-drain functionality for the selected port.
22142  Preconditions:
22143  None.
22144  Parameters:
22145  index - Identifier for the device instance to be configured
22146  channel - Identifier for the PORT channel: A, B, C, etc.
22147  mask - Mask of type PORTS_DATA_MASK
22148  Returns:
22149  None.
22150  Example:
22151  <code>
22152  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22153  // application developer.
22154  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22155  </code>
22156  Remarks:
22157  Not all features are available on all devices. Refer to the specific device
22158  data sheet for availability.
22159 */
22160 
22161 void
22163  PORTS_MODULE_ID index ,
22164  PORTS_CHANNEL channel ,
22165  PORTS_DATA_MASK mask ) ;
22166 // *****************************************************************************
22167 /* Function:
22168  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22169  PORTS_DATA_MASK mask )
22170  Summary:
22171  Disables the open-drain functionality for the selected port.
22172  <p><b>Implementation:</b> Dynamic</p>
22173  Description:
22174  This function disables the open-drain functionality for the selected port.
22175  Preconditions:
22176  None.
22177  Parameters:
22178  index - Identifier for the device instance to be configured
22179  channel - Identifier for the PORT channel: A, B, C, etc.
22180  mask - Mask of type PORTS_DATA_MASK
22181  Returns:
22182  None.
22183  Example:
22184  <code>
22185  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22186  // application developer.
22187  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22188  </code>
22189  Remarks:
22190  Not all features are available on all devices. Refer to the specific device
22191  data sheet for availability.
22192 */
22193 
22194 void
22196  PORTS_MODULE_ID index ,
22197  PORTS_CHANNEL channel ,
22198  PORTS_DATA_MASK mask ) ;
22199 // *****************************************************************************
22200 /* Function:
22201  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22202  (
22203  PORTS_MODULE_ID index,
22204  PORTS_CHANNEL channel
22205  )
22206  Summary:
22207  Reads the interrupt status from the I/O port.
22208  <p><b>Implementation:</b> Dynamic</p>
22209  Description:
22210  This function reads the interrupt status from the I/O port.
22211  Preconditions:
22212  The interrupts should have been configured.
22213  Parameters:
22214  index - Identifier for the device instance to be configured
22215  channel - Identifier for the PORT channel: A, B, C, etc.
22216  Returns:
22217  Returns the interrupt status of the port channel.
22218  Example:
22219  <code>
22220  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22221  // application developer.
22222  PORTS_DATA_TYPE channelStatus;
22223  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22224  </code>
22225  Remarks:
22226  None.
22227 */
22228 
22231  PORTS_MODULE_ID index ,
22232  PORTS_CHANNEL channel ) ;
22233 // *****************************************************************************
22234 // *****************************************************************************
22235 // Section: SYS PORT PINS REMAPING Routines
22236 // *****************************************************************************
22237 // *****************************************************************************
22238 // *****************************************************************************
22239 /* Function:
22240  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22241  PORTS_REMAP_INPUT_FUNCTION function,
22242  PORTS_REMAP_INPUT_PIN remapPin )
22243  Summary:
22244  Input/Output (I/O) function remapping.
22245  <p><b>Implementation:</b> Dynamic</p>
22246  Description:
22247  This function controls the I/O function remapping.
22248  Precondition:
22249  None.
22250  Parameters:
22251  index - Identifier for the device instance to be configured
22252  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22253  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22254  Returns:
22255  None.
22256  Example:
22257  <code>
22258  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22259  // application developer.
22260  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22261  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22262  </code>
22263  Remarks:
22264  This feature may not be available on all devices. Please refer to the
22265  specific device data sheet to determine availability or use
22266  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22267  this feature is available.
22268 */
22269 
22270 void
22272  PORTS_MODULE_ID index ,
22273  PORTS_REMAP_INPUT_FUNCTION function ,
22274  PORTS_REMAP_INPUT_PIN remapPin ) ;
22275 // *****************************************************************************
22276 /* Function:
22277  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22278  PORTS_REMAP_OUTPUT_FUNCTION function,
22279  PORTS_REMAP_OUTPUT_PIN remapPin )
22280  Summary:
22281  Input/Output (I/O) function remapping.
22282  <p><b>Implementation:</b> Dynamic</p>
22283  Description:
22284  This function controls the I/O function remapping.
22285  Precondition:
22286  None.
22287  Parameters:
22288  index - Identifier for the device instance to be configured
22289  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22290  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22291  Returns:
22292  None.
22293  Example:
22294  <code>
22295  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22296  // application developer.
22297  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22298  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22299  </code>
22300  Remarks:
22301  This feature may not be available on all devices. Please refer to the
22302  specific device data sheet to determine availability or use
22303  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22304  this feature is available.
22305 */
22306 
22307 void
22309  PORTS_MODULE_ID index ,
22310  PORTS_REMAP_OUTPUT_FUNCTION function ,
22311  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22312 // *****************************************************************************
22313 // *****************************************************************************
22314 // Section: SYS Change Notification Pins Routines
22315 // *****************************************************************************
22316 // *****************************************************************************
22317 // *****************************************************************************
22318 /* Function:
22319  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22320  Summary:
22321  Globally enables the change notification for the selected port.
22322  <p><b>Implementation:</b> Dynamic</p>
22323  Description:
22324  This function globally enables the change notification for the selected port.
22325  Preconditions:
22326  None.
22327  Parameters:
22328  None.
22329  Returns:
22330  None.
22331  Example:
22332  <code>
22333  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22334  // application developer.
22335  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22336  </code>
22337  Remarks:
22338  Not all features are available on all devices. Refer to the specific device
22339  data sheet for availability.
22340 */
22341 
22342 void
22344  PORTS_MODULE_ID index ) ;
22345 // *****************************************************************************
22346 /* Function:
22347  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22348  Summary:
22349  Globally disables the change notification for the selected port.
22350  <p><b>Implementation:</b> Dynamic</p>
22351  Description:
22352  This function globally disables the change notification for the selected port.
22353  Preconditions:
22354  None.
22355  Parameters:
22356  None.
22357  Returns:
22358  None.
22359  Example:
22360  <code>
22361  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22362  // application developer.
22363  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22364  </code>
22365  Remarks:
22366  Not all features are available on all devices. Refer to the specific device
22367  data sheet for availability.
22368 */
22369 
22370 void
22372  PORTS_MODULE_ID index ) ;
22373 // *****************************************************************************
22374 /* Function:
22375  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22376  PORTS_CHANGE_NOTICE_PIN pinNum,
22377  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22378  Summary:
22379  Enables the change notification for the selected port.
22380  <p><b>Implementation:</b> Dynamic</p>
22381  Description:
22382  This function enables the change notification for the selected port.
22383  Preconditions:
22384  None.
22385  Parameters:
22386  index - Identifier for the device instance to be configured
22387  value - Pull-up enable or disable value
22388  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22389  Returns:
22390  None.
22391  Example:
22392  <code>
22393  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22394  // application developer.
22395  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22396  PORTS_CHANGE_NOTICE_PIN pinNum;
22397  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22398  </code>
22399  Remarks:
22400  Not all features are available on all devices. Refer to the specific device
22401  data sheet for availability.
22402 */
22403 
22404 void
22406  PORTS_MODULE_ID index ,
22407  PORTS_CHANGE_NOTICE_PIN pinNum ,
22409 // *****************************************************************************
22410 /* Function:
22411  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22412  PORTS_CHANGE_NOTICE_PIN pinNum )
22413  Summary:
22414  Disables the change notification for the selected port.
22415  <p><b>Implementation:</b> Dynamic</p>
22416  Description:
22417  This function disables the change notification for the selected port.
22418  Preconditions:
22419  None.
22420  Parameters:
22421  index - Identifier for the device instance to be configured
22422  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22423  Returns:
22424  None.
22425  Example:
22426  <code>
22427  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22428  // application developer.
22429  PORTS_CHANGE_NOTICE_PIN pinNum;
22430  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22431  </code>
22432  Remarks:
22433  Not all features are available on all devices. Refer to the specific device
22434  data sheet for availability.
22435 */
22436 
22437 void
22439  PORTS_MODULE_ID index ,
22440  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22441 // *****************************************************************************
22442 /* Function:
22443  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22444  Summary:
22445  Enables the change notification for the selected port in Sleep or Idle mode.
22446  <p><b>Implementation:</b> Dynamic</p>
22447  Description:
22448  This function enables the change notification for the selected port in Sleep
22449  or Idle mode.
22450  Preconditions:
22451  None.
22452  Parameters:
22453  None.
22454  Returns:
22455  None.
22456  Example:
22457  <code>
22458  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22459  // application developer.
22460  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22461  </code>
22462  Remarks:
22463  Not all features are available on all devices. Refer to the specific device
22464  data sheet for availability.
22465 */
22466 
22467 void
22469  PORTS_MODULE_ID index ) ;
22470 // *****************************************************************************
22471 /* Function:
22472  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22473  Summary:
22474  Disables the change notification for the selected port in Sleep or Idle mode.
22475  <p><b>Implementation:</b> Dynamic</p>
22476  Description:
22477  This function disables the change notification for the selected port in Sleep
22478  or Idle mode.
22479  Preconditions:
22480  None.
22481  Parameters:
22482  None.
22483  Returns:
22484  None.
22485  Example:
22486  <code>
22487  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22488  // application developer.
22489  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22490  </code>
22491  Remarks:
22492  Not all features are available on all devices. Refer to the specific device
22493  data sheet for availability.
22494 */
22495 
22496 void
22498  PORTS_MODULE_ID index ) ;
22499 // *****************************************************************************
22500 /* Function:
22501  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22502  PORTS_CHANGE_NOTICE_PIN pinNum )
22503  Summary:
22504  Enables a weak pull-up on the change notification pin.
22505  <p><b>Implementation:</b> Dynamic</p>
22506  Description:
22507  This function enables a weak pull-up on the change notification pin.
22508  Preconditions:
22509  None.
22510  Parameters:
22511  index - Identifier for the device instance to be configured
22512  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22513  Returns:
22514  None.
22515  Example:
22516  <code>
22517  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22518  // application developer.
22519  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22520  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22521  </code>
22522  Remarks:
22523  Not all features are available on all devices. Refer to the specific device
22524  data sheet for availability.
22525 */
22526 
22527 void
22529  PORTS_MODULE_ID index ,
22530  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22531 // *****************************************************************************
22532 /* Function:
22533  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22534  PORTS_CHANGE_NOTICE_PIN pinNum )
22535  Summary:
22536  Disables a weak pull-up on the change notification pin.
22537  <p><b>Implementation:</b> Dynamic</p>
22538  Description:
22539  This function Disables a weak pull-up on the change notification pin.
22540  Preconditions:
22541  None.
22542  Parameters:
22543  index - Identifier for the device instance to be configured
22544  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22545  Returns:
22546  None.
22547  Example:
22548  <code>
22549  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22550  // application developer.
22551  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22552  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22553  </code>
22554  Remarks:
22555  Not all features are available on all devices. Refer to the specific device
22556  data sheet for availability.
22557 */
22558 
22559 void
22561  PORTS_MODULE_ID index ,
22562  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22563 // *****************************************************************************
22564 // *****************************************************************************
22565 // Section: SYS PORT PINS Control Routines
22566 // *****************************************************************************
22567 // *****************************************************************************
22568 // *****************************************************************************
22569 /* Function:
22570  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22571  PORTS_ANALOG_PIN pin,
22572  PORTS_PIN_MODE mode)
22573  Summary:
22574  Enables the selected pin as analog or digital.
22575  <p><b>Implementation:</b> Dynamic</p>
22576  Description:
22577  This function enables the selected pin as analog or digital.
22578  Preconditions:
22579  None.
22580  Parameters:
22581  index - Identifier for the device instance to be configured
22582  pin - Possible values of PORTS_ANALOG_PIN
22583  mode - Possible values of PORTS_PIN_MODE
22584  Returns:
22585  None.
22586  Example:
22587  <code>
22588  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22589  // application developer.
22590  // MY_PIN - PORTS_ANALOG_PIN_AN0
22591  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22592  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22593  </code>
22594  Remarks:
22595  Not all features are available on all devices. Refer to the specific device
22596  data sheet for availability.
22597 */
22598 
22599 void
22601  PORTS_MODULE_ID index ,
22602  PORTS_ANALOG_PIN pin ,
22603  PORTS_PIN_MODE mode ) ;
22604 // *****************************************************************************
22605 /* Function:
22606  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22607  PORTS_CHANNEL channel,
22608  PORTS_BIT_POS bitPos
22609  bool value )
22610  Summary:
22611  Writes the selected digital pin.
22612  <p><b>Implementation:</b> Dynamic</p>
22613  Description:
22614  This function writes the selected digital pin.
22615  Preconditions:
22616  None.
22617  Parameters:
22618  index - Identifier for the device instance to be configured
22619  channel - Identifier for the PORT channel: A, B, C, etc.
22620  bitPos - Possible values of PORTS_BIT_POS
22621  value - Value to be written to the specific pin/latch:
22622  - true - Sets the bit
22623  - false - Clears the bit
22624  Returns:
22625  None.
22626  Example:
22627  <code>
22628  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22629  // application developer.
22630  // MY_PINNUM - PORTS_PIN_10
22631  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22632  </code>
22633  Remarks:
22634  Not all features are available on all devices. Refer to the specific device
22635  data sheet for availability.
22636 */
22637 
22638 void
22640  PORTS_MODULE_ID index ,
22641  PORTS_CHANNEL channel ,
22642  PORTS_BIT_POS bitPos ,
22643  bool value ) ;
22644 // *****************************************************************************
22645 /* Function:
22646  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22647  PORTS_CHANNEL channel,
22648  PORTS_BIT_POS bitPos )
22649  Summary:
22650  Reads the data driven on the selected digital pin.
22651  <p><b>Implementation:</b> Dynamic</p>
22652  Description:
22653  This function reads the data driven on the selected
22654  digital output pin.
22655  Preconditions:
22656  None.
22657  Parameters:
22658  index - Identifier for the device instance to be configured
22659  channel - Identifier for the PORT channel: A, B, C, etc.
22660  bitPos - Possible values of PORTS_BIT_POS
22661  Returns:
22662  The status of the data driven on the port pin.
22663  Example:
22664  <code>
22665  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22666  // application developer.
22667  // MY_PINNUM - PORTS_PIN_10
22668  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22669  </code>
22670  Remarks:
22671  Not all features are available on all devices. Refer to the specific device
22672  data sheet for availability.
22673 */
22674 
22675 bool
22677  PORTS_MODULE_ID index ,
22678  PORTS_CHANNEL channel ,
22679  PORTS_BIT_POS bitPos ) ;
22680 // *****************************************************************************
22681 /* Function:
22682  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22683  PORTS_CHANNEL channel,
22684  PORTS_BIT_POS bitPos )
22685  Summary:
22686  Reads the selected digital pin.
22687  <p><b>Implementation:</b> Dynamic</p>
22688  Description:
22689  This function reads the selected digital pin, not the Latch.
22690  Preconditions:
22691  None.
22692  Parameters:
22693  index - Identifier for the device instance to be configured
22694  channel - Identifier for the PORT channel: A, B, C, etc.
22695  bitPos - Possible values of PORTS_BIT_POS
22696  Returns:
22697  The status of the port pin.
22698  Example:
22699  <code>
22700  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22701  // application developer.
22702  // MY_PINNUM - PORTS_PIN_10
22703  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22704  </code>
22705  Remarks:
22706  Not all features are available on all devices. Refer to the specific device
22707  data sheet for availability.
22708 */
22709 
22710 bool
22712  PORTS_MODULE_ID index ,
22713  PORTS_CHANNEL channel ,
22714  PORTS_BIT_POS bitPos ) ;
22715 // *****************************************************************************
22716 /* Function:
22717  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22718  PORTS_CHANNEL channel,
22719  PORTS_BIT_POS bitPos )
22720  Summary:
22721  Toggles the selected digital pin.
22722  <p><b>Implementation:</b> Dynamic</p>
22723  Description:
22724  This function toggles the selected digital pin.
22725  Preconditions:
22726  None.
22727  Parameters:
22728  index - Identifier for the device instance to be configured
22729  channel - Identifier for the PORT channel: A, B, C, etc.
22730  bitPos - Possible values of PORTS_BIT_POS
22731  Returns:
22732  None.
22733  Example:
22734  <code>
22735  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22736  // application developer.
22737  // MY_PINNUM - PORTS_PIN_10
22738  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22739  </code>
22740  Remarks:
22741  Not all features are available on all devices. Refer to the specific device
22742  data sheet for availability.
22743 */
22744 
22745 void
22747  PORTS_MODULE_ID index ,
22748  PORTS_CHANNEL channel ,
22749  PORTS_BIT_POS bitPos ) ;
22750 // *****************************************************************************
22751 /* Function:
22752  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22753  PORTS_CHANNEL channel,
22754  PORTS_BIT_POS bitPos )
22755  Summary:
22756  Sets the selected digital pin/latch.
22757  <p><b>Implementation:</b> Dynamic</p>
22758  Description:
22759  This function sets the selected digital pin/latch.
22760  Preconditions:
22761  None.
22762  Parameters:
22763  index - Identifier for the device instance to be configured
22764  channel - Identifier for the PORT channel: A, B, C, etc.
22765  bitPos - Possible values of PORTS_BIT_POS
22766  Returns:
22767  None.
22768  Example:
22769  <code>
22770  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22771  // application developer.
22772  // MY_PINNUM - PORTS_PIN_10
22773  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22774  </code>
22775  Remarks:
22776  Not all features are available on all devices. Refer to the specific device
22777  data sheet for availability.
22778 */
22779 
22780 void
22782  PORTS_MODULE_ID index ,
22783  PORTS_CHANNEL channel ,
22784  PORTS_BIT_POS bitPos ) ;
22785 // *****************************************************************************
22786 /* Function:
22787  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22788  PORTS_CHANNEL channel,
22789  PORTS_BIT_POS bitPos )
22790  Summary:
22791  Clears the selected digital pin.
22792  <p><b>Implementation:</b> Dynamic</p>
22793  Description:
22794  This function clears the selected digital pin.
22795  Preconditions:
22796  None.
22797  Parameters:
22798  index - Identifier for the device instance to be configured
22799  channel - Identifier for the PORT channel: A, B, C, etc.
22800  bitPos - Possible values of PORTS_BIT_POS
22801  Returns:
22802  None.
22803  Example:
22804  <code>
22805  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22806  // application developer.
22807  // MY_PINNUM - PORTS_IO_PIN_10
22808  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22809  </code>
22810  Remarks:
22811  Not all features are available on all devices. Refer to the specific device
22812  data sheet for availability.
22813 */
22814 
22815 void
22817  PORTS_MODULE_ID index ,
22818  PORTS_CHANNEL channel ,
22819  PORTS_BIT_POS bitPos ) ;
22820 // *****************************************************************************
22821 /* Function:
22822  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22823  SYS_PORTS_PIN_DIRECTION pinDir,
22824  PORTS_CHANNEL channel,
22825  PORTS_BIT_POS bitPos )
22826  Summary:
22827  Enables the direction for the selected pin.
22828  <p><b>Implementation:</b> Dynamic</p>
22829  Description:
22830  This function enables the direction for the selected pin.
22831  Preconditions:
22832  None.
22833  Parameters:
22834  index - Identifier for the device instance to be configured
22835  pinDir - Pin direction
22836  channel - Identifier for the PORT channel: A, B, C, etc.
22837  bitPos - Possible values of PORTS_BIT_POS
22838  Returns:
22839  None.
22840  Example:
22841  <code>
22842  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22843  // application developer.
22844  // MY_PINNUM - PORTS_PIN_10
22845  SYS_PORTS_PIN_DIRECTION pinDir;
22846  pinDir = SYS_PORTS_DIRECTION_INPUT;
22847  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22848  </code>
22849  Remarks:
22850  Not all features are available on all devices. Refer to the specific device
22851  data sheet for availability.
22852 */
22853 
22854 void
22856  PORTS_MODULE_ID index ,
22857  SYS_PORTS_PIN_DIRECTION pinDir ,
22858  PORTS_CHANNEL channel ,
22859  PORTS_BIT_POS bitPos ) ;
22860 // *****************************************************************************
22861 /* Function:
22862  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22863  PORTS_CHANNEL channel,
22864  PORTS_BIT_POS bitPos )
22865  Summary:
22866  Enables the open-drain functionality for the selected pin.
22867  <p><b>Implementation:</b> Dynamic</p>
22868  Description:
22869  This function enables the open-drain functionality for the selected pin.
22870  Preconditions:
22871  None.
22872  Parameters:
22873  index - Identifier for the device instance to be configured
22874  channel - Identifier for the PORT channel: A, B, C, etc.
22875  bitPos - Possible values of PORTS_BIT_POS
22876  Returns:
22877  None.
22878  Example:
22879  <code>
22880  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22881  // application developer.
22882  // MY_PINNUM - PORTS_PIN_10
22883  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22884  </code>
22885  Remarks:
22886  Not all features are available on all devices. Refer to the specific device
22887  data sheet for availability.
22888 */
22889 
22890 void
22892  PORTS_MODULE_ID index ,
22893  PORTS_CHANNEL channel ,
22894  PORTS_BIT_POS bitPos ) ;
22895 // *****************************************************************************
22896 /* Function:
22897  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22898  PORTS_CHANNEL channel,
22899  PORTS_BIT_POS bitPos )
22900  Summary:
22901  Disables the open-drain functionality for the selected pin.
22902  <p><b>Implementation:</b> Dynamic</p>
22903  Description:
22904  This function disables the open-drain functionality for the selected pin.
22905  Preconditions:
22906  None.
22907  Parameters:
22908  index - Identifier for the device instance to be configured
22909  channel - Identifier for the PORT channel: A, B, C, etc.
22910  bitPos - Possible values of PORTS_BIT_POS
22911  Returns:
22912  None.
22913  Example:
22914  <code>
22915  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22916  // application developer.
22917  // MY_PINNUM - PORTS_PIN_10
22918  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22919  </code>
22920  Remarks:
22921  Not all features are available on all devices. Refer to the specific device
22922  data sheet for availability.
22923 */
22924 
22925 void
22927  PORTS_MODULE_ID index ,
22928  PORTS_CHANNEL channel ,
22929  PORTS_BIT_POS bitPos ) ;
22930 // *****************************************************************************
22931 /* Function:
22932  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22933  PORTS_CHANNEL channel,
22934  PORTS_BIT_POS bitPos )
22935  Summary:
22936  Enables the pull-up functionality for the selected pin.
22937  <p><b>Implementation:</b> Dynamic</p>
22938  Description:
22939  This function enables the pull-up functionality for the selected pin.
22940  Preconditions:
22941  None.
22942  Parameters:
22943  index - Identifier for the device instance to be configured
22944  channel - Identifier for the PORT channel: A, B, C, etc.
22945  bitPos - Possible values of PORTS_BIT_POS
22946  Returns:
22947  None.
22948  Example:
22949  <code>
22950  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22951  // application developer.
22952  // MY_PINNUM - PORTS_PIN_10
22953  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22954  </code>
22955  Remarks:
22956  Not all features are available on all devices. Refer to the specific device
22957  data sheet for availability.
22958 */
22959 
22960 void
22962  PORTS_MODULE_ID index ,
22963  PORTS_CHANNEL channel ,
22964  PORTS_BIT_POS bitPos ) ;
22965 // *****************************************************************************
22966 /* Function:
22967  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22968  PORTS_CHANNEL channel,
22969  PORTS_BIT_POS bitPos )
22970  Summary:
22971  Disables the pull-up functionality for the selected pin.
22972  <p><b>Implementation:</b> Dynamic</p>
22973  Description:
22974  This function disables the pull-up functionality for the selected pin.
22975  Preconditions:
22976  None.
22977  Parameters:
22978  index - Identifier for the device instance to be configured
22979  channel - Identifier for the PORT channel: A, B, C, etc.
22980  bitPos - Possible values of PORTS_BIT_POS
22981  Returns:
22982  None.
22983  Example:
22984  <code>
22985  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22986  // application developer.
22987  // MY_PINNUM - PORTS_PIN_10
22988  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22989  </code>
22990  Remarks:
22991  Not all features are available on all devices. Refer to the specific device
22992  data sheet for availability.
22993 */
22994 
22995 void
22997  PORTS_MODULE_ID index ,
22998  PORTS_CHANNEL channel ,
22999  PORTS_BIT_POS bitPos ) ;
23000 // *****************************************************************************
23001 /* Function:
23002  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23003  PORTS_CHANNEL channel,
23004  PORTS_BIT_POS bitPos )
23005  Summary:
23006  Enables the pull-down functionality for the selected pin.
23007  <p><b>Implementation:</b> Dynamic</p>
23008  Description:
23009  This function enables the pull-down functionality for the selected pin.
23010  Preconditions:
23011  None.
23012  Parameters:
23013  index - Identifier for the device instance to be configured
23014  channel - Identifier for the PORT channel: A, B, C, etc.
23015  bitPos - Possible values of PORTS_BIT_POS
23016  Returns:
23017  None.
23018  Example:
23019  <code>
23020  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23021  // application developer.
23022  // MY_PINNUM - PORTS_PIN_10
23023  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23024  </code>
23025  Remarks:
23026  Not all features are available on all devices. Refer to the specific device
23027  data sheet for availability.
23028 */
23029 
23030 void
23032  PORTS_MODULE_ID index ,
23033  PORTS_CHANNEL channel ,
23034  PORTS_BIT_POS bitPos ) ;
23035 // *****************************************************************************
23036 /* Function:
23037  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23038  PORTS_CHANNEL channel,
23039  PORTS_BIT_POS bitPos )
23040  Summary:
23041  Disables the pull-down functionality for the selected pin.
23042  <p><b>Implementation:</b> Dynamic</p>
23043  Description:
23044  This function disables the pull-down functionality for the selected pin.
23045  Preconditions:
23046  None.
23047  Parameters:
23048  index - Identifier for the device instance to be configured
23049  channel - Identifier for the PORT channel: A, B, C, etc.
23050  bitPos - Possible values of PORTS_BIT_POS
23051  Returns:
23052  None.
23053  Example:
23054  <code>
23055  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23056  // application developer.
23057  // MY_PINNUM - PORTS_PIN_10
23058  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23059  </code>
23060  Remarks:
23061  Not all features are available on all devices. Refer to the specific device
23062  data sheet for availability.
23063 */
23064 
23065 void
23067  PORTS_MODULE_ID index ,
23068  PORTS_CHANNEL channel ,
23069  PORTS_BIT_POS bitPos ) ;
23070 //******************************************************************************
23071 /* Function:
23072  void SYS_PORTS_InterruptEnable
23073  (
23074  PORTS_MODULE_ID index,
23075  PORTS_CHANNEL channel,
23076  PORTS_BIT_POS bitPos,
23077  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23078  )
23079  Summary:
23080  Enables the selected interrupt for the selected port pin.
23081  Description:
23082  This function enables the selected interrupt for the selected port pin.
23083  Preconditions:
23084  Select the pull-up or pull-down as required.
23085  Parameters:
23086  index - Identifier for the device instance to be configured
23087  channel - Identifier for the PORT channel: A, B, C, etc.
23088  bitPos - Possible values of PORTS_BIT_POS
23089  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23090  Returns:
23091  None.
23092  Example:
23093  <code>
23094  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23095  </code>
23096  Remarks:
23097  None.
23098 */
23099 
23100 void
23102  PORTS_MODULE_ID index ,
23103  PORTS_CHANNEL channel ,
23104  PORTS_BIT_POS bitPos ,
23105  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23106 //DOM-IGNORE-BEGIN
23107 //DOM-IGNORE-END
23108  //SYS_PORTS_H
23109 /*******************************************************************************
23110  End of File
23111 */
23112 
23113 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23114 /* CLOSE_FILE Include File */
23115 
23116 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23117 /*******************************************************************************
23118  SPI Driver Interface
23119  Company:
23120  Microchip Technology Inc.
23121  File Name:
23122  drv_spi.h
23123  Summary:
23124  SPI device driver interface file.
23125  Description:
23126  The SPI driver provides a simple interface to manage the SPI module.
23127  This file defines the interface definitions and prototypes for the SPI driver.
23128 *******************************************************************************/
23129 //DOM-IGNORE-BEGIN
23130 /*******************************************************************************
23131 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23132 Microchip licenses to you the right to use, modify, copy and distribute
23133 Software only when embedded on a Microchip microcontroller or digital signal
23134 controller that is integrated into your product or third party product
23135 (pursuant to the sublicense terms in the accompanying license agreement).
23136 You should refer to the license agreement accompanying this Software for
23137 additional information regarding your rights and obligations.
23138 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23139 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23140 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23141 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23142 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23143 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23144 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23145 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23146 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23147 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23148 *******************************************************************************/
23149 //DOM-IGNORE-END
23150 #ifndef _DRV_SPI_H
23151 #define _DRV_SPI_H
23152 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23153 /*******************************************************************************
23154  SPI Driver Interface
23155  Company:
23156  Microchip Technology Inc.
23157  File Name:
23158  drv_spi_definitions.h
23159  Summary:
23160  SPI device driver interface file.
23161  Description:
23162  The SPI driver provides a simple interface to manage the SPI module.
23163  This file defines the interface definitions and prototypes for the SPI
23164  driver.
23165 *******************************************************************************/
23166 //DOM-IGNORE-BEGIN
23167 /*******************************************************************************
23168 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23169 Microchip licenses to you the right to use, modify, copy and distribute
23170 Software only when embedded on a Microchip microcontroller or digital signal
23171 controller that is integrated into your product or third party product
23172 (pursuant to the sublicense terms in the accompanying license agreement).
23173 You should refer to the license agreement accompanying this Software for
23174 additional information regarding your rights and obligations.
23175 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23176 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23177 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23178 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23179 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23180 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23181 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23182 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23183 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23184 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23185 *******************************************************************************/
23186 //DOM-IGNORE-END
23187 #ifndef _DRV_SPI_DEFINITIONS_H
23188 #define _DRV_SPI_DEFINITIONS_H
23189 // *****************************************************************************
23190 // *****************************************************************************
23191 // Section: Data Types
23192 // *****************************************************************************
23193 // *****************************************************************************
23194 #include <stdint.h>
23195 #include <stdbool.h>
23196 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23197 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23198 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23199 /*******************************************************************************
23200  SPI Peripheral Library Interface Header
23201  Company:
23202  Microchip Technology Inc.
23203  File Name:
23204  plib_spi.h
23205  Summary:
23206  SPI Peripheral Library Interface Header for common definitions.
23207  Description:
23208  This header file contains the function prototypes and definitions of
23209  the data types and constants that make up the interface to the SPI
23210  PLIB.
23211  *******************************************************************************/
23212 // DOM-IGNORE-BEGIN
23213 /*******************************************************************************
23214 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23215 Microchip licenses to you the right to use, modify, copy and distribute
23216 Software only when embedded on a Microchip microcontroller or digital signal
23217 controller that is integrated into your product or third party product
23218 (pursuant to the sublicense terms in the accompanying license agreement).
23219 You should refer to the license agreement accompanying this Software for
23220 additional information regarding your rights and obligations.
23221 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23222 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23223 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23224 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23225 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23226 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23227 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23228 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23229 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23230 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23231  *******************************************************************************/
23232 // DOM-IGNORE-END
23233 #ifndef _PLIB_SPI_H
23234 #define _PLIB_SPI_H
23235 // DOM-IGNORE-BEGIN
23236 // DOM-IGNORE-END
23237 // *****************************************************************************
23238 // *****************************************************************************
23239 // Section: Included Files (continued at end of file)
23240 // *****************************************************************************
23241 // *****************************************************************************
23242 /* This section lists the other files that are included in this file. However,
23243  please see the end of the file for additional implementation header files
23244  that are also included.
23245  */
23246 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23247 //DOM-IGNORE-BEGIN
23248 /*******************************************************************************
23249 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23250 Microchip licenses to you the right to use, modify, copy and distribute
23251 Software only when embedded on a Microchip microcontroller or digital signal
23252 controller that is integrated into your product or third party product
23253 (pursuant to the sublicense terms in the accompanying license agreement).
23254 You should refer to the license agreement accompanying this Software for
23255 additional information regarding your rights and obligations.
23256 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23257 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23258 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23259 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23260 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23261 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23262 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23263 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23264 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23265 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23266  *******************************************************************************/
23267 //DOM-IGNORE-END
23268 #ifndef _PLIB_SPI_PROCESSOR_H
23269 #define _PLIB_SPI_PROCESSOR_H
23270 #error "Can't find header"
23271 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23272 /* CLOSE_FILE Include File */
23273 
23274 // *****************************************************************************
23275 // *****************************************************************************
23276 // Section: Constants & Data Types
23277 // *****************************************************************************
23278 // *****************************************************************************
23279 // *****************************************************************************
23280 // *****************************************************************************
23281 // Section: SPI Peripheral Library Interface Routines
23282 // *****************************************************************************
23283 // *****************************************************************************
23284 //******************************************************************************
23285 /* Function:
23286  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23287  Summary:
23288  Enables the SPI module.
23289  Description:
23290  This function enables the SPI module.
23291  This operation is atomic.
23292  Precondition:
23293  None.
23294  Parameters:
23295  index - Identifier for the device instance to be configured
23296  Returns:
23297  None.
23298  Example:
23299  <code>
23300  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23301  // application developer.
23302  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23303  </code>
23304  Remarks:
23305  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23306  before use.
23307  This function implements an operation of the enable control feature. This
23308  feature may not be available on all devices. Please refer to the specific
23309  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23310  in your application to automatically determine whether this feature is available.
23311  */
23312 
23313 void
23314  PLIB_SPI_Enable (
23315  SPI_MODULE_ID index ) ;
23316 //******************************************************************************
23317 /* Function:
23318  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23319  Summary:
23320  Disables the SPI module.
23321  Description:
23322  This function disables the SPI module.
23323  This operation is atomic.
23324  Precondition:
23325  None.
23326  Parameters:
23327  index - Identifier for the device instance to be configured
23328  Returns:
23329  None.
23330  Example:
23331  <code>
23332  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23333  // application developer.
23334  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23335  </code>
23336  Remarks:
23337  This function implements an operation of the enable control feature. This
23338  feature may not be available on all devices. Please refer to the specific
23339  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23340  in your application to automatically determine whether this feature is available.
23341  */
23342 
23343 void
23345  SPI_MODULE_ID index ) ;
23346 //******************************************************************************
23347 /* Function:
23348  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23349  Summary:
23350  Discontinues module operation when the device enters Idle mode.
23351  Description:
23352  This function sets up the SPI module such that module operation is disabled
23353  when the device enters Idle mode.
23354  This operation is atomic.
23355  Precondition:
23356  None.
23357  Parameters:
23358  index - Identifier for the device instance to be configured
23359  Returns:
23360  None.
23361  Example:
23362  <code>
23363  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23364  // application developer.
23365  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23366  </code>
23367  Remarks:
23368  This function implements an operation of the stop in idle control feature.
23369  This feature may not be available on all devices. Please refer to the
23370  specific device data sheet to determine availability or use
23371  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23372  determine if this feature is available.
23373  */
23374 
23375 void
23377  SPI_MODULE_ID index ) ;
23378 //******************************************************************************
23379 /* Function:
23380  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23381  Summary:
23382  Continues module operation when the device enters Idle mode.
23383  Description:
23384  This function sets up the SPI module such that module operation is continued
23385  when the device enters Idle mode.
23386  This operation is atomic.
23387  Precondition:
23388  None.
23389  Parameters:
23390  index - Identifier for the device instance to be configured
23391  Returns:
23392  None.
23393  Example:
23394  <code>
23395  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23396  // application developer.
23397  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23398  </code>
23399  Remarks:
23400  This function implements an operation of the stop in idle control feature.
23401  This feature may not be available on all devices. Please refer to the
23402  specific device data sheet to determine availability or use
23403  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23404  this feature is available.
23405  */
23406 
23407 void
23409  SPI_MODULE_ID index ) ;
23410 //******************************************************************************
23411 /* Function:
23412  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23413  Summary:
23414  Returns the current status of the SPI receiver overflow.
23415  Description:
23416  This function returns the current status of the SPI receiver overflow.
23417  This operation is atomic.
23418  Precondition:
23419  None.
23420  Parameters:
23421  index - Identifier for the device instance to be configured
23422  Returns:
23423  SPI receiver overflow status:
23424  - true - A new byte/word is completely received and discarded.
23425  The user software has not read the previous data in
23426  the SPI buffer register.
23427  - false - No Overflow has occurred
23428  Example:
23429  <code>
23430  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23431  // application developer.
23432  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23433  </code>
23434  Remarks:
23435  This function implements an operation of the receiver overflow status feature.
23436  This feature may not be available on all devices. Please refer to the
23437  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23438  in your application to automatically determine whether this feature is available.
23439  */
23440 
23441 bool
23443  SPI_MODULE_ID index ) ;
23444 //******************************************************************************
23445 /* Function:
23446  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23447  Summary:
23448  Clears the SPI receive overflow flag.
23449  Description:
23450  This function clears the SPI receive overflow flag.
23451  This operation is atomic.
23452  Precondition:
23453  None.
23454  Parameters:
23455  index - Identifier for the device instance to be configured
23456  Returns:
23457  None.
23458  Example:
23459  <code>
23460  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23461  // application developer.
23462  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23463  </code>
23464  Remarks:
23465  This function implements an operation of the receiver overflow status feature.
23466  This feature may not be available on all devices. Please refer to the
23467  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23468  in your application to automatically determine whether this feature is available.
23469  */
23470 
23471 void
23473  SPI_MODULE_ID index ) ;
23474 //******************************************************************************
23475 /* Function:
23476  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23477  Summary:
23478  Returns the current transmit buffer status of the SPI module.
23479  Description:
23480  This function returns the current transmit buffer status of the SPI module.
23481  This operation is atomic.
23482  Precondition:
23483  None.
23484  Parameters:
23485  index - Identifier for the device instance to be configured
23486  Returns:
23487  - true - Transmit not yet started, transmit buffer is full
23488  - false - Transmit started, transmit buffer is empty/not full
23489  Example:
23490  <code>
23491  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23492  // application developer.
23493  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23494  </code>
23495  Remarks:
23496  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23497  occur, loading the transmit buffer. Automatically cleared in hardware when
23498  the SPI module transfers data from the transmit buffer to the shift register.
23499  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23500  occur, loading the last available buffer. Automatically cleared in hardware
23501  when the buffer is available for writing.
23502  This function implements an operation of the transmit buffer status feature.
23503  This feature may not be available on all devices. Please refer to the
23504  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23505  in your application to automatically determine whether this feature is available.
23506  */
23507 
23508 bool
23510  SPI_MODULE_ID index ) ;
23511 //******************************************************************************
23512 /* Function:
23513  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23514  Summary:
23515  Returns the current status of the SPI receive buffer.
23516  Description:
23517  This function returns the current status of the SPI receive buffer.
23518  This operation is atomic.
23519  Precondition:
23520  None.
23521  Parameters:
23522  index - Identifier for the device instance to be configured
23523  Returns:
23524  Receiver Buffer Full Status:
23525  - true - Receive complete, receive buffer is full
23526  - false - Receive is not complete, receive buffer is empty
23527  Example:
23528  <code>
23529  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23530  // application developer.
23531  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23532  </code>
23533  Remarks:
23534  In Standard Buffer mode - automatically set in hardware when the SPI module
23535  transfers data from the shift register to the receive buffer. Automatically
23536  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23537  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23538  transfers data from the shift register to the receive buffer, filling the
23539  last unread buffer. Automatically cleared in hardware when a buffer is available
23540  for a transfer from the shift register.
23541  This function implements an operation of the receiver buffer status feature.
23542  This feature may not be available on all devices. Please refer to the
23543  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23544  in your application to automatically determine whether this feature is available.
23545  */
23546 
23547 bool
23549  SPI_MODULE_ID index ) ;
23550 //******************************************************************************
23551 /* Function:
23552  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23553  Summary:
23554  Enables the selected SPI pins.
23555  Description:
23556  This function enables the selected SPI pins.
23557  Precondition:
23558  None.
23559  Parameters:
23560  index - Identifier for the device instance to be configured
23561  pin - One of the SPI_PIN enumeration values as the SPI pin
23562  Returns:
23563  None.
23564  Example:
23565  <code>
23566  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23567  // application developer.
23568  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23569  </code>
23570  Remarks:
23571  This function implements an operation of the pin control feature.
23572  This feature may not be available on all devices. Please refer to the
23573  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23574  in your application to automatically determine whether this feature is available.
23575  */
23576 
23577 void
23579  SPI_MODULE_ID index ,
23580  SPI_PIN pin ) ;
23581 //******************************************************************************
23582 /* Function:
23583  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23584  Summary:
23585  Enables the selected SPI pins.
23586  Description:
23587  This function enables the selected SPI pins.
23588  Precondition:
23589  None.
23590  Parameters:
23591  index - Identifier for the device instance to be configured
23592  pin - One of the SPI_PIN enumeration values as the SPI pin
23593  Returns:
23594  None.
23595  Example:
23596  <code>
23597  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23598  // application developer.
23599  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23600  </code>
23601  Remarks:
23602  This function implements an operation of the pin control feature.
23603  This feature may not be available on all devices. Please refer to the
23604  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23605  in your application to automatically determine whether this feature is available.
23606  */
23607 
23608 void
23610  SPI_MODULE_ID index ,
23611  SPI_PIN pin ) ;
23612 //******************************************************************************
23613 /* Function:
23614  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23615  SPI_COMMUNICATION_WIDTH width )
23616  Summary:
23617  Selects the data width for the SPI communication.
23618  Description:
23619  This function selects the data width for the SPI communication.
23620  This operation is atomic.
23621  Precondition:
23622  None.
23623  Parameters:
23624  index - Identifier for the device instance to be configured
23625  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23626  SPI buffer width
23627  Returns:
23628  None.
23629  Example:
23630  <code>
23631  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23632  // application developer.
23633  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23634  </code>
23635  Remarks:
23636  This function implements an operation of the communication width feature.
23637  This feature may not be available on all devices. Please refer to the
23638  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23639  in your application to automatically determine whether this feature is available.
23640  */
23641 
23642 void
23644  SPI_MODULE_ID index ,
23645  SPI_COMMUNICATION_WIDTH width ) ;
23646 //******************************************************************************
23647 /* Function:
23648  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23649  SPI_AUDIO_COMMUNICATION_WIDTH width )
23650  Summary:
23651  Selects the data width for the SPI audio communication.
23652  Description:
23653  This function selects the data width for the SPI audio communication.
23654  This operation is atomic.
23655  Precondition:
23656  None.
23657  Parameters:
23658  index - Identifier for the device instance to be configured
23659  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23660  SPI buffer width
23661  Returns:
23662  None.
23663  Example:
23664  <code>
23665  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23666  // application developer.
23667  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23668  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23669  </code>
23670  Remarks:
23671  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23672  This function implements an operation of the audio communication width feature.
23673  This feature may not be available on all devices. Please refer to the
23674  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23675  in your application to automatically determine whether this feature is available.
23676  */
23677 
23678 void
23680  SPI_MODULE_ID index ,
23681  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23682 //******************************************************************************
23683 /* Function:
23684  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23685  SPI_INPUT_SAMPLING_PHASE phase)
23686  Summary:
23687  Selects the SPI data input sample phase.
23688  Description:
23689  This function selects the input sampling phase in Master mode.
23690  Precondition:
23691  None.
23692  Parameters:
23693  index - Identifier for the device instance to be configured
23694  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23695  sampling phase
23696  Returns:
23697  None.
23698  Example:
23699  <code>
23700  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23701  // application developer.
23702  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23703  </code>
23704  Remarks:
23705  This function implements an operation of the input sample phase feature.
23706  This feature may not be available on all devices. Please refer to the
23707  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23708  in your application to automatically determine whether this feature is available.
23709  */
23710 
23711 void
23713  SPI_MODULE_ID index ,
23714  SPI_INPUT_SAMPLING_PHASE phase ) ;
23715 //******************************************************************************
23716 /* Function:
23717  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23718  SPI_OUTPUT_DATA_PHASE data)
23719  Summary:
23720  Selects serial output data change.
23721  Description:
23722  This function selects serial output data change.
23723  Precondition:
23724  None.
23725  Parameters:
23726  index - Identifier for the device instance to be configured
23727  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23728  SPI serial output data change
23729  Returns:
23730  None.
23731  Example:
23732  <code>
23733  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23734  // application developer.
23735  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23736  </code>
23737  Remarks:
23738  This function implements an operation of the output data phase feature.
23739  This feature may not be available on all devices. Please refer to the
23740  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23741  in your application to automatically determine whether this feature is available.
23742  */
23743 
23744 void
23746  SPI_MODULE_ID index ,
23747  SPI_OUTPUT_DATA_PHASE phase ) ;
23748 //******************************************************************************
23749 /* Function:
23750  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23751  SPI_CLOCK_POLARITY polarity)
23752  Summary:
23753  Enables clock polarity.
23754  Description:
23755  This function enables clock polarity.
23756  Precondition:
23757  None.
23758  Parameters:
23759  index - Identifier for the device instance to be configured
23760  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23761  Returns:
23762  None.
23763  Example:
23764  <code>
23765  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23766  // application developer.
23767  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23768  </code>
23769  Remarks:
23770  This function implements an operation of the clock polarity feature.
23771  This feature may not be available on all devices. Please refer to the
23772  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23773  in your application to automatically determine whether this feature is available.
23774  */
23775 
23776 void
23778  SPI_MODULE_ID index ,
23779  SPI_CLOCK_POLARITY polarity ) ;
23780 //******************************************************************************
23781 /* Function:
23782  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23783  Summary:
23784  Enables the SPI in Master mode.
23785  Description:
23786  This function enables the SPI in Master mode.
23787  This operation is atomic.
23788  Precondition:
23789  None.
23790  Parameters:
23791  index - Identifier for the device instance to be configured
23792  Returns:
23793  None.
23794  Example:
23795  <code>
23796  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23797  // application developer.
23798  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23799  </code>
23800  Remarks:
23801  This function implements an operation of the master enable control feature.
23802  This feature may not be available on all devices. Please refer to the
23803  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23804  in your application to automatically determine whether this feature is available.
23805  */
23806 
23807 void
23809  SPI_MODULE_ID index ) ;
23810 //******************************************************************************
23811 /* Function:
23812  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23813  Summary:
23814  Enables the SPI in Slave mode.
23815  Description:
23816  This function enables the SPI in Slave mode.
23817  This operation is atomic.
23818  Precondition:
23819  None.
23820  Parameters:
23821  index - Identifier for the device instance to be configured
23822  Returns:
23823  None.
23824  Example:
23825  <code>
23826  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23827  // application developer.
23828  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23829  </code>
23830  Remarks:
23831  This function implements an operation of the master enable control feature.
23832  This feature may not be available on all devices. Please refer to the
23833  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23834  in your application to automatically determine whether this feature is available.
23835  */
23836 
23837 void
23839  SPI_MODULE_ID index ) ;
23840 //******************************************************************************
23841 /* Function:
23842  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23843  uint32_t baudRate )
23844  Summary:
23845  Sets the baud rate to the desired value.
23846  Description:
23847  This function sets the baud rate to the desired value.
23848  Precondition:
23849  None.
23850  Parameters:
23851  index - Identifier for the device instance to be configured
23852  clockFrequency - Clock frequency
23853  baudrate - Baud rate value
23854  Returns:
23855  None.
23856  Example:
23857  <code>
23858  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23859  // application developer.
23860  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23861  </code>
23862  Remarks:
23863  Setting a new baud rate value causes the baud rate timer to reset.
23864  This ensures that the baud rate timer does not have to overflow before
23865  outputting the new baud rate.
23866  If the system clock is changed during an active receive operation, a
23867  receive error or data loss may result. To avoid this issue, verify that
23868  no receptions are in progress before changing the system clock.
23869  This function implements an operation of the baud rate set feature.
23870  This feature may not be available on all devices. Please refer to the
23871  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23872  in your application to automatically determine whether this feature is available.
23873  */
23874 
23875 void
23877  SPI_MODULE_ID index ,
23878  uint32_t clockFrequency ,
23879  uint32_t baudRate ) ;
23880 //******************************************************************************
23881 /* Function:
23882  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23883  Summary:
23884  Returns the current SPI module activity status.
23885  Description:
23886  This function returns the current SPI module activity status.
23887  This operation is atomic.
23888  Precondition:
23889  None.
23890  Parameters:
23891  index - Identifier for the device instance to be configured
23892  Returns:
23893  - true - SPI module is currently busy with some transactions
23894  - false - SPI module is currently idle
23895  Example:
23896  <code>
23897  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23898  // application developer.
23899  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23900  </code>
23901  Remarks:
23902  This function implements an operation of the bus status feature.
23903  This feature may not be available on all devices. Please refer to the
23904  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23905  in your application to automatically determine whether this feature is available.
23906  */
23907 
23908 bool
23909  PLIB_SPI_IsBusy (
23910  SPI_MODULE_ID index ) ;
23911 //******************************************************************************
23912 /* Function:
23913  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23914  Summary:
23915  Returns the current status of the receive (RX) FIFO sign-extended data.
23916  Description:
23917  This function returns the current status of the receive (RX) FIFO
23918  sign-extended data.
23919  This operation is atomic.
23920  Precondition:
23921  None.
23922  Parameters:
23923  index - Identifier for the device instance to be configured
23924  Returns:
23925  - true - Data from RX FIFO is sign-extended
23926  - false - Data from RX FIFO is not sign-extended
23927  Example:
23928  <code>
23929  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23930  // application developer.
23931  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23932  </code>
23933  Remarks:
23934  This function implements an operation of the data sign feature.
23935  This feature may not be available on all devices. Please refer to the
23936  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23937  in your application to automatically determine whether this feature is available.
23938  */
23939 
23940 bool
23942  SPI_MODULE_ID index ) ;
23943 //******************************************************************************
23944 /* Function:
23945  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23946  Summary:
23947  Enables Master mode slave select.
23948  Description:
23949  This function enables Master mode slave select.
23950  This operation is atomic.
23951  Precondition:
23952  None.
23953  Parameters:
23954  index - Identifier for the device instance to be configured
23955  Returns:
23956  None.
23957  Example:
23958  <code>
23959  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23960  // application developer.
23961  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23962  </code>
23963  Remarks:
23964  This feature does not support Framed SPI mode.
23965  This function implements an operation of the Master mode slave select feature.
23966  This feature may not be available on all devices. Please refer to the
23967  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23968  in your application to automatically determine whether this feature is available.
23969 
23970  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23971  */
23972 
23973 void
23975  SPI_MODULE_ID index ) ;
23976 //******************************************************************************
23977 /* Function:
23978  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23979  Summary:
23980  Disables Master mode slave select.
23981  Description:
23982  This function disables Master mode slave select.
23983  This operation is atomic.
23984  Precondition:
23985  None.
23986  Parameters:
23987  index - Identifier for the device instance to be configured
23988  Returns:
23989  None.
23990  Example:
23991  <code>
23992  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23993  // application developer.
23994  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
23995  </code>
23996  Remarks:
23997  This feature does not support Framed SPI mode.
23998  This function implements an operation of the slave select feature.
23999  This feature may not be available on all devices. Please refer to the
24000  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24001  in your application to automatically determine whether this feature is available.
24002 
24003  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24004  */
24005 
24006 void
24008  SPI_MODULE_ID index ) ;
24009 //******************************************************************************
24010 /* Function:
24011  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24012  Summary:
24013  Returns the current status of the transmit underrun.
24014  Description:
24015  This function returns the current status of the transmit underrun.
24016  This operation is atomic.
24017  Precondition:
24018  None.
24019  Parameters:
24020  index - Identifier for the device instance to be configured
24021  Returns:
24022  - true - Transmit buffer has encountered an underrun condition
24023  - false - Transmit buffer run has not encountered an underrun condition
24024  Example:
24025  <code>
24026  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24027  // application developer.
24028  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24029  </code>
24030  Remarks:
24031  Valid in Framed Sync mode.
24032  This function implements an operation of the transmit underrun status feature.
24033  This feature may not be available on all devices. Please refer to the
24034  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24035  in your application to automatically determine whether this feature is available.
24036  */
24037 
24038 bool
24040  SPI_MODULE_ID index ) ;
24041 //******************************************************************************
24042 /* Function:
24043  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24044  Summary:
24045  Clears the SPI transmit underrun flag.
24046  Description:
24047  This function clears the SPI transmit underrun flag.
24048  This operation is atomic.
24049  Precondition:
24050  None.
24051  Parameters:
24052  index - Identifier for the device instance to be configured
24053  Returns:
24054  None.
24055  Example:
24056  <code>
24057  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24058  // application developer.
24059  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24060  </code>
24061  Remarks:
24062  This function implements an operation of the transmit underrun status feature.
24063  This feature may not be available on all devices. Please refer to the
24064  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24065  in your application to automatically determine whether this feature is available.
24066  */
24067 
24068 void
24070  SPI_MODULE_ID index ) ;
24071 //******************************************************************************
24072 /* Function:
24073  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24074  Summary:
24075  Returns the current status of the transmit buffer.
24076  Description:
24077  This function returns the current status of the transmit buffer.
24078  This operation is atomic.
24079  Precondition:
24080  None.
24081  Parameters:
24082  index - Identifier for the device instance to be configured
24083  Returns:
24084  - true - Transmit buffer is empty
24085  - false - Transmit buffer is not empty
24086  Example:
24087  <code>
24088  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24089  // application developer.
24090  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24091  </code>
24092  Remarks:
24093  This function implements an operation of the transmit buffer empty status feature.
24094  This feature may not be available on all devices. Please refer to the
24095  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24096  in your application to automatically determine whether this feature is available.
24097  */
24098 
24099 bool
24101  SPI_MODULE_ID index ) ;
24102 //******************************************************************************
24103 /* Function:
24104  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24105  Summary:
24106  Enables the SPI enhanced buffer.
24107  Description:
24108  This function enables the SPI enhanced buffer.
24109  This operation is atomic.
24110  Precondition:
24111  None.
24112  Parameters:
24113  index - Identifier for the device instance to be configured
24114  Returns:
24115  None.
24116  Example:
24117  <code>
24118  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24119  // application developer.
24120  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24121  </code>
24122  Remarks:
24123  This enables the enhanced buffer mode.
24124  This function implements an operation of the FIFO control feature.
24125  This feature may not be available on all devices. Please refer to the
24126  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24127  in your application to automatically determine whether this feature is available.
24128  */
24129 
24130 void
24132  SPI_MODULE_ID index ) ;
24133 //******************************************************************************
24134 /* Function:
24135  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24136  Summary:
24137  Disables the SPI enhanced buffer.
24138  Description:
24139  This function disables the SPI enhanced buffer.
24140  This operation is atomic.
24141  Precondition:
24142  None.
24143  Parameters:
24144  index - Identifier for the device instance to be configured
24145  Returns:
24146  None.
24147  Example:
24148  <code>
24149  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24150  // application developer.
24151  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24152  </code>
24153  Remarks:
24154  Enables the legacy standard single buffer mode.
24155  This function implements an operation of the FIFO control feature.
24156  This feature may not be available on all devices. Please refer to the
24157  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24158  in your application to automatically determine whether this feature is available.
24159  */
24160 
24161 void
24163  SPI_MODULE_ID index ) ;
24164 //******************************************************************************
24165 /* Function:
24166  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24167  Summary:
24168  Reads the SPI Buffer Element Count bits for either receive or transmit.
24169  Description:
24170  This function reads the number of SPI transfers pending for Master mode
24171  and the number of unread SPI transfers for Slave mode.
24172  Precondition:
24173  None.
24174  Parameters:
24175  index - Identifier for the device instance to be configured
24176  type - One of the SPI_FIFO_TYPE enumeration values
24177  Returns:
24178  CountValue - Buffer element count bits
24179  Example:
24180  <code>
24181  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24182  // application developer.
24183  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24184  </code>
24185  Remarks:
24186  Valid in Enhanced Buffer mode.
24187  This function implements an operation of the FIFO control feature.
24188  This feature may not be available on all devices. Please refer to the
24189  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24190  in your application to automatically determine whether this feature is available.
24191  */
24192 
24193 uint8_t
24195  SPI_MODULE_ID index ,
24196  SPI_FIFO_TYPE type ) ;
24197 //******************************************************************************
24198 /* Function:
24199  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24200  Summary:
24201  Returns the current status of the SPI shift register.
24202  Description:
24203  This function returns the current status of the SPI shift register.
24204  This operation is atomic.
24205  Precondition:
24206  None.
24207  Parameters:
24208  index - Identifier for the device instance to be configured
24209  Returns:
24210  - true - SPI shift register is empty and ready to send or receive
24211  - false - SPI shift register is not empty
24212  Example:
24213  <code>
24214  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24215  // application developer.
24216  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24217  </code>
24218  Remarks:
24219  Valid in Enhanced Buffer mode.
24220  This function implements an operation of the FIFO status feature.
24221  This feature may not be available on all devices. Please refer to the
24222  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24223  in your application to automatically determine whether this feature is available.
24224  */
24225 
24226 bool
24228  SPI_MODULE_ID index ) ;
24229 //******************************************************************************
24230 /* Function:
24231  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24232  Summary:
24233  Returns the current status of the SPI receive FIFO.
24234  Description:
24235  This function returns the current status of the SPI receive FIFO.
24236  This operation is atomic.
24237  Precondition:
24238  None.
24239  Parameters:
24240  index - Identifier for the device instance to be configured
24241  Returns:
24242  - true - Receive FIFO is empty
24243  - false - Receive FIFO is not empty
24244  Example:
24245  <code>
24246  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24247  // application developer.
24248  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24249  </code>
24250  Remarks:
24251  Valid in Enhanced Buffer mode.
24252  This function implements an operation of the FIFO status feature.
24253  This feature may not be available on all devices. Please refer to the
24254  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24255  in your application to automatically determine whether this feature is available.
24256  */
24257 
24258 bool
24260  SPI_MODULE_ID index ) ;
24261 //******************************************************************************
24262 /* Function:
24263  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24264  SPI_FIFO_INTERRUPT mode)
24265  Summary:
24266  Selects the SPI buffer interrupt mode.
24267  Description:
24268  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24269  Precondition:
24270  None.
24271  Parameters:
24272  index - Identifier for the device instance to be configured
24273  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24274  interrupt mode
24275  Returns:
24276  None.
24277  Example:
24278  <code>
24279  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24280  // application developer.
24281  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24282  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24283  </code>
24284  Remarks:
24285  Valid in Enhanced Buffer mode.
24286  This function implements an operation of the FIFO interrupt feature.
24287  This feature may not be available on all devices. Please refer to the
24288  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24289  in your application to automatically determine whether this feature is available.
24290  */
24291 
24292 void
24294  SPI_MODULE_ID index ,
24295  SPI_FIFO_INTERRUPT mode ) ;
24296 //******************************************************************************
24297 /* Function:
24298  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24299  Summary:
24300  Enables framed SPI support.
24301  Description:
24302  This function enables framed SPI support.
24303  This operation is atomic.
24304  Precondition:
24305  None.
24306  Parameters:
24307  index - Identifier for the device instance to be configured
24308  Returns:
24309  None.
24310  Example:
24311  <code>
24312  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24313  // application developer.
24314  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24315  </code>
24316  Remarks:
24317  This function implements an operation of the framed communication feature.
24318  This feature may not be available on all devices. Please refer to the
24319  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24320  in your application to automatically determine whether this feature is available.
24321  */
24322 
24323 void
24325  SPI_MODULE_ID index ) ;
24326 //******************************************************************************
24327 /* Function:
24328  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24329  Summary:
24330  Disables framed SPI support.
24331  Description:
24332  This function disables framed SPI support.
24333  This operation is atomic.
24334  Precondition:
24335  None.
24336  Parameters:
24337  index - Identifier for the device instance to be configured
24338  Returns:
24339  None.
24340  Example:
24341  <code>
24342  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24343  // application developer.
24344  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24345  </code>
24346  Remarks:
24347  This function implements an operation of the framed communication feature.
24348  This feature may not be available on all devices. Please refer to the
24349  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24350  in your application to automatically determine whether this feature is available.
24351  */
24352 
24353 void
24355  SPI_MODULE_ID index ) ;
24356 //******************************************************************************
24357 /* Function:
24358  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24359  SPI_FRAME_PULSE_DIRECTION direction)
24360  Summary:
24361  Selects the frame sync pulse direction.
24362  Description:
24363  This function selects the frame sync pulse direction.
24364  Precondition:
24365  None.
24366  Parameters:
24367  index - Identifier for the device instance to be configured
24368  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24369  as the SPI frame sync pulse polarity
24370  Returns:
24371  None.
24372  Example:
24373  <code>
24374  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24375  // application developer.
24376  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24377  </code>
24378  Remarks:
24379  This function implements an operation of the framed communication feature.
24380  This feature may not be available on all devices. Please refer to the
24381  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24382  in your application to automatically determine whether this feature is available.
24383  */
24384 
24385 void
24387  SPI_MODULE_ID index ,
24388  SPI_FRAME_PULSE_DIRECTION direction ) ;
24389 //******************************************************************************
24390 /* Function:
24391  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24392  SPI_FRAME_PULSE_POLARITY polarity)
24393  Summary:
24394  Selects the frame sync pulse polarity.
24395  Description:
24396  This function selects the frame sync pulse polarity.
24397  Precondition:
24398  None.
24399  Parameters:
24400  index - Identifier for the device instance to be configured
24401  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24402  sync pulse polarity
24403  Returns:
24404  None.
24405  Example:
24406  <code>
24407  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24408  // application developer.
24409  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24410  </code>
24411  Remarks:
24412  Available only for Frame mode.
24413  This function implements an operation of the framed communication feature.
24414  This feature may not be available on all devices. Please refer to the
24415  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24416  in your application to automatically determine whether this feature is available.
24417  */
24418 
24419 void
24421  SPI_MODULE_ID index ,
24422  SPI_FRAME_PULSE_POLARITY polarity ) ;
24423 //******************************************************************************
24424 /* Function:
24425  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24426  SPI_FRAME_PULSE_EDGE edge)
24427  Summary:
24428  Selects the frame sync pulse edge.
24429  Description:
24430  This function selects the frame sync pulse edge.
24431  Precondition:
24432  None.
24433  Parameters:
24434  index - Identifier for the device instance to be configured
24435  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24436  SPI frame sync pulse edge
24437  Returns:
24438  None.
24439  Example:
24440  <code>
24441  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24442  // application developer.
24443  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24444  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24445  </code>
24446  Remarks:
24447  This function implements an operation of the framed communication feature.
24448  This feature may not be available on all devices. Please refer to the
24449  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24450  in your application to automatically determine whether this feature is available.
24451  */
24452 
24453 void
24455  SPI_MODULE_ID index ,
24456  SPI_FRAME_PULSE_EDGE edge ) ;
24457 //******************************************************************************
24458 /* Function:
24459  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24460  SPI_FRAME_PULSE_WIDTH width)
24461  Summary:
24462  Sets the frame sync pulse width.
24463  Description:
24464  This function sets the frame sync pulse width.
24465  Precondition:
24466  None.
24467  Parameters:
24468  index - Identifier for the device instance to be configured
24469  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24470  frame sync pulse width.
24471  Returns:
24472  None.
24473  Example:
24474  <code>
24475  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24476  // application developer.
24477  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24478  </code>
24479  Remarks:
24480  Length of the word is dependent on the communication mode.
24481  This function implements an operation of the framed communication feature.
24482  This feature may not be available on all devices. Please refer to the
24483  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24484  in your application to automatically determine whether this feature is available.
24485  */
24486 
24487 void
24489  SPI_MODULE_ID index ,
24490  SPI_FRAME_PULSE_WIDTH width ) ;
24491 //******************************************************************************
24492 /* Function:
24493  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24494  SPI_FRAME_SYNC_PULSE pulse)
24495  Summary:
24496  Selects at which character the SPI frame sync pulse is generated.
24497  Description:
24498  This function selects at which character the SPI frame sync pulse is generated.
24499  Precondition:
24500  None.
24501  Parameters:
24502  index - Identifier for the device instance to be configured
24503  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24504  frame sync pulse count
24505  Returns:
24506  None.
24507  Example:
24508  <code>
24509  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24510  // application developer.
24511  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24512  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24513  </code>
24514  Remarks:
24515  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24516  This function implements an operation of the framed communication feature.
24517  This feature may not be available on all devices. Please refer to the
24518  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24519  in your application to automatically determine whether this feature is available.
24520  */
24521 
24522 void
24524  SPI_MODULE_ID index ,
24525  SPI_FRAME_SYNC_PULSE pulse ) ;
24526 //******************************************************************************
24527 /* Function:
24528  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24529  Summary:
24530  Returns the current status of the SPI frame error.
24531  Description:
24532  This function returns the current status of the SPI frame error.
24533  This operation is atomic.
24534  Precondition:
24535  None.
24536  Parameters:
24537  index - Identifier for the device instance to be configured
24538  Returns:
24539  - true - Frame error detected
24540  - false - No frame error detected
24541  Example:
24542  <code>
24543  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24544  // application developer.
24545  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24546  </code>
24547  Remarks:
24548  Valid only if Frame mode is enabled.
24549  This function implements an operation of the framed communication feature.
24550  This feature may not be available on all devices. Please refer to the
24551  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24552  in your application to automatically determine whether this feature is available.
24553  */
24554 
24555 bool
24557  SPI_MODULE_ID index ) ;
24558 //******************************************************************************
24559 /* Function:
24560  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24561  Summary:
24562  Clears the SPI frame error flag.
24563  Description:
24564  This function clears the SPI frame error flag.
24565  This operation is atomic.
24566  Precondition:
24567  None.
24568  Parameters:
24569  index - Identifier for the device instance to be configured
24570  Returns:
24571  None.
24572  Example:
24573  <code>
24574  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24575  // application developer.
24576  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24577  </code>
24578  Remarks:
24579  This function implements an operation of the frame error status feature.
24580  This feature may not be available on all devices. Please refer to the
24581  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24582  in your application to automatically determine whether this feature is available.
24583  */
24584 
24585 void
24587  SPI_MODULE_ID index ) ;
24588 //******************************************************************************
24589 /* Function:
24590  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24591  Summary:
24592  Clears the SPI receive buffer.
24593  Description:
24594  This function clears the SPI receive buffer.
24595  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24596  This operation is atomic.
24597  Precondition:
24598  None.
24599  Parameters:
24600  index - Identifier for the device instance to be configured
24601  Returns:
24602  None.
24603  Example:
24604  <code>
24605  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24606  // application developer.
24607  //This call will flush the receive buffer.
24608  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24609  </code>
24610  Remarks:
24611  This function implements an operation of the buffer control feature.
24612  This feature may not be available on all devices. Please refer to the
24613  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24614  in your application to automatically determine whether this feature is available.
24615  */
24616 
24617 void
24619  SPI_MODULE_ID index ) ;
24620 //******************************************************************************
24621 /* Function:
24622  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24623  Summary:
24624  Returns the SPI buffer value.
24625  Description:
24626  This function returns the SPI buffer value.
24627  This operation is atomic.
24628  Precondition:
24629  None.
24630  Parameters:
24631  index - Identifier for the device instance to be configured
24632  Returns:
24633  Reads the SPI buffer.
24634  Example:
24635  <code>
24636  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24637  // application developer.
24638  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24639  </code>
24640  Remarks:
24641  This function implements an operation of the buffer control feature.
24642  This feature may not be available on all devices. Please refer to the
24643  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24644  in your application to automatically determine whether this feature is available.
24645  */
24646 
24647 uint8_t
24649  SPI_MODULE_ID index ) ;
24650 //******************************************************************************
24651 /* Function:
24652  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24653  Summary:
24654  Returns 16-bit SPI buffer value.
24655  Description:
24656  This function returns 16-bit SPI buffer value.
24657  This operation is atomic.
24658  Precondition:
24659  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24660  Parameters:
24661  index - Identifier for the device instance to be configured
24662  Returns:
24663  Returns the SPI 16-bit buffer value.
24664  Example:
24665  <code>
24666 #define MY_SPI_INSTANCE SPI_ID_1
24667 
24668  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24669  </code>
24670  Remarks:
24671  This function implements an operation of the buffer control feature.
24672  This feature may not be available on all devices. Please refer to the
24673  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24674  in your application to automatically determine whether this feature is available.
24675  */
24676 
24677 uint16_t
24679  SPI_MODULE_ID index ) ;
24680 //******************************************************************************
24681 /* Function:
24682  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24683  Summary:
24684  Returns 32-bit SPI buffer value.
24685  Description:
24686  This function returns 32-bit SPI buffer value.
24687  This operation is atomic.
24688  Precondition:
24689  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24690  Parameters:
24691  index - Identifier for the device instance to be configured
24692  Returns:
24693  Returns the SPI 32-bit buffer value.
24694  Example:
24695  <code>
24696 #define MY_SPI_INSTANCE SPI_ID_1
24697 
24698  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24699  </code>
24700  Remarks:
24701  This function implements an operation of the buffer control feature.
24702  This feature may not be available on all devices. Please refer to the
24703  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24704  in your application to automatically determine whether this feature is available.
24705  */
24706 
24707 uint32_t
24709  SPI_MODULE_ID index ) ;
24710 //******************************************************************************
24711 /* Function:
24712  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24713  Summary:
24714  Write the data to the SPI buffer.
24715  Description:
24716  This function writes data to the SPI buffer.
24717  This operation is atomic.
24718  Precondition:
24719  None.
24720  Parameters:
24721  index - Identifier for the device instance to be configured
24722  data - Data to written to the SPI buffer
24723  Returns:
24724  None.
24725  Example:
24726  <code>
24727  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24728  // application developer.
24729  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24730  </code>
24731  Remarks:
24732  This function implements an operation of the buffer control feature.
24733  This feature may not be available on all devices. Please refer to the
24734  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24735  in your application to automatically determine whether this feature is available.
24736  */
24737 
24738 void
24740  SPI_MODULE_ID index ,
24741  uint8_t data ) ;
24742 //******************************************************************************
24743 /* Function:
24744  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24745  Summary:
24746  Writes 16-bit data to the SPI buffer.
24747  Description:
24748  This function writes 16-bit data to the SPI buffer.
24749  This operation is atomic.
24750  Precondition:
24751  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24752  Parameters:
24753  index - Identifier for the device instance to be configured
24754  data - 16-bit data to be written to the SPI buffer
24755  Returns:
24756  None.
24757  Example:
24758  <code>
24759 #define MY_SPI_INSTANCE SPI_ID_1
24760 
24761  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24762  </code>
24763  Remarks:
24764  This function implements an operation of the buffer control feature.
24765  This feature may not be available on all devices. Please refer to the
24766  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24767  in your application to automatically determine whether this feature is available.
24768  */
24769 
24770 void
24772  SPI_MODULE_ID index ,
24773  uint16_t data ) ;
24774 //******************************************************************************
24775 /* Function:
24776  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24777  Summary:
24778  Write 32-bit data to the SPI buffer.
24779  Description:
24780  This function writes 32-bit data to the SPI buffer.
24781  This operation is atomic.
24782  Precondition:
24783  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24784  Parameters:
24785  index - Identifier for the device instance to be configured
24786  data - 32-bit data to be written to the SPI buffer
24787  Returns:
24788  None.
24789  Example:
24790  <code>
24791 #define MY_SPI_INSTANCE SPI_ID_1
24792 
24793  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24794  </code>
24795  Remarks:
24796  This function implements an operation of the buffer control feature.
24797  This feature may not be available on all devices. Please refer to the
24798  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24799  in your application to automatically determine whether this feature is available.
24800  */
24801 
24802 void
24804  SPI_MODULE_ID index ,
24805  uint32_t data ) ;
24806 //******************************************************************************
24807 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24808  Summary:
24809  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24810  register.
24811  Description:
24812  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24813  (SPIxRXB)) register.
24814  This operation is atomic.
24815  Preconditions:
24816  None.
24817  Parameters:
24818  index - Identifier for the device instance
24819  Returns:
24820  The address of the SPIxBUF register
24821  Remarks:
24822  None.
24823 */
24824 
24825 void *
24827  SPI_MODULE_ID index ) ;
24828 //******************************************************************************
24829 /* Function:
24830  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24831  SPI_BAUD_RATE_CLOCK type)
24832  Summary:
24833  Selects the type of clock is used by the Baud Rate Generator.
24834  Description:
24835  This function selects the type of clock is used by the Baud Rate Generator.
24836  Precondition:
24837  None.
24838  Parameters:
24839  index - Identifier for the device instance to be configured
24840  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24841  Returns:
24842  None.
24843  Example:
24844  <code>
24845  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24846  // application developer.
24847  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24848  </code>
24849  Remarks:
24850  This function implements an operation of the baud rate clock control feature.
24851  This feature may not be available on all devices. Please refer to the
24852  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24853  in your application to automatically determine whether this feature is available.
24854  */
24855 
24856 void
24858  SPI_MODULE_ID index ,
24859  SPI_BAUD_RATE_CLOCK type ) ;
24860 //******************************************************************************
24861 /* Function:
24862  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24863  SPI_ERROR_INTERRUPT error)
24864  Summary:
24865  Enables SPI error interrupts
24866  Description:
24867  This function enables SPI error interrupts.
24868  Precondition:
24869  None.
24870  Parameters:
24871  index - Identifier for the device instance to be configured
24872  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24873  SPI interrupt error
24874  Returns:
24875  None.
24876  Example:
24877  <code>
24878  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24879  // application developer.
24880  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24881  </code>
24882  Remarks:
24883  This function implements an operation of the error interrupt control feature.
24884  This feature may not be available on all devices. Please refer to the
24885  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24886  in your application to automatically determine whether this feature is available.
24887  */
24888 
24889 void
24891  SPI_MODULE_ID index ,
24892  SPI_ERROR_INTERRUPT error ) ;
24893 //******************************************************************************
24894 /* Function:
24895  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24896  SPI_ERROR_INTERRUPT error)
24897  Summary:
24898  Enables SPI error interrupts.
24899  Description:
24900  This function enables SPI error interrupts.
24901  Precondition:
24902  None.
24903  Parameters:
24904  index - Identifier for the device instance to be configured
24905  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24906  SPI interrupt error
24907  Returns:
24908  None.
24909  Example:
24910  <code>
24911  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24912  // application developer.
24913  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24914  </code>
24915  Remarks:
24916  This function implements an operation of the error interrupt control feature.
24917  This feature may not be available on all devices. Please refer to the
24918  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24919  in your application to automatically determine whether this feature is available.
24920  */
24921 
24922 void
24924  SPI_MODULE_ID index ,
24925  SPI_ERROR_INTERRUPT error ) ;
24926 //******************************************************************************
24927 /* Function:
24928  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24929  Summary:
24930  Enables the SPI error.
24931  Description:
24932  This function enables the SPI error.
24933  This operation is atomic.
24934  Precondition:
24935  None.
24936  Parameters:
24937  index - Identifier for the device instance to be configured
24938  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24939  Returns:
24940  None.
24941  Example:
24942  <code>
24943  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24944  // application developer.
24945  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24946  </code>
24947  Remarks:
24948  This function implements an operation of the audio error control feature.
24949  This feature may not be available on all devices. Please refer to the
24950  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24951  in your application to automatically determine whether this feature is available.
24952  */
24953 
24954 void
24956  SPI_MODULE_ID index ,
24957  SPI_AUDIO_ERROR error ) ;
24958 //******************************************************************************
24959 /* Function:
24960  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24961  Summary:
24962  Disables the SPI error.
24963  Description:
24964  This function disables the SPI error.
24965  This operation is atomic.
24966  Precondition:
24967  None.
24968  Parameters:
24969  index - Identifier for the device instance to be configured
24970  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24971  Returns:
24972  None.
24973  Example:
24974  <code>
24975  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24976  // application developer.
24977  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24978  </code>
24979  Remarks:
24980  This function implements an operation of the audio error control feature.
24981  This feature may not be available on all devices. Please refer to the
24982  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24983  in your application to automatically determine whether this feature is available.
24984  */
24985 
24986 void
24988  SPI_MODULE_ID index ,
24989  SPI_AUDIO_ERROR error ) ;
24990 //******************************************************************************
24991 /* Function:
24992  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
24993  Summary:
24994  Audio protocol is enabled.
24995  Description:
24996  This function enables the audio protocol.
24997  This operation is atomic.
24998  Precondition:
24999  Disable the SPI module by calling PLIB_SPI_Disable.
25000  Parameters:
25001  index - Identifier for the device instance to be configured
25002  Returns:
25003  None.
25004  Example:
25005  <code>
25006  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25007  // application developer.
25008  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25009  </code>
25010  Remarks:
25011  This function implements an operation of the audio protocol control feature.
25012  This feature may not be available on all devices. Please refer to the
25013  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25014  in your application to automatically determine whether this feature is available.
25015  */
25016 
25017 void
25019  SPI_MODULE_ID index ) ;
25020 //******************************************************************************
25021 /* Function:
25022  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25023  Summary:
25024  Audio protocol is disabled.
25025  Description:
25026  This function disables the audio protocol.
25027  This operation is atomic.
25028  Precondition:
25029  None.
25030  Parameters:
25031  index - Identifier for the device instance to be configured
25032  Returns:
25033  None.
25034  Example:
25035  <code>
25036  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25037  // application developer.
25038  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25039  </code>
25040  Remarks:
25041  This function implements an operation of the audio protocol control feature.
25042  This feature may not be available on all devices. Please refer to the
25043  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25044  in your application to automatically determine whether this feature is available.
25045  */
25046 
25047 void
25049  SPI_MODULE_ID index ) ;
25050 //******************************************************************************
25051 /* Function:
25052  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25053  SPI_AUDIO_TRANSMIT_MODE mode)
25054  Summary:
25055  Selects the transmit audio data format.
25056  Description:
25057  This function selects the transmit audio data format.
25058  Precondition:
25059  None.
25060  Parameters:
25061  index - Identifier for the device instance to be configured
25062  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25063  transmit audio format
25064  Returns:
25065  None.
25066  Example:
25067  <code>
25068  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25069  // application developer.
25070  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25071  </code>
25072  Remarks:
25073  This function implements an operation of the audio transmit mode feature.
25074  This feature may not be available on all devices. Please refer to the
25075  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25076  in your application to automatically determine whether this feature is available.
25077  */
25078 
25079 void
25081  SPI_MODULE_ID index ,
25082  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25083 //******************************************************************************
25084 /* Function:
25085  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25086  SPI_AUDIO_PROTOCOL mode )
25087  Summary:
25088  Selects the Audio Protocol mode.
25089  Description:
25090  This function selects the Audio Protocol mode.
25091  Precondition:
25092  None.
25093  Parameters:
25094  index - Identifier for the device instance to be configured
25095  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25096  audio protocol
25097  Returns:
25098  None.
25099  Example:
25100  <code>
25101  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25102  // application developer.
25103  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25104  </code>
25105  Remarks:
25106  This function implements an operation of the audio protocol mode feature.
25107  This feature may not be available on all devices. Please refer to the
25108  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25109  in your application to automatically determine whether this feature is available.
25110  */
25111 
25112 void
25114  SPI_MODULE_ID index ,
25115  SPI_AUDIO_PROTOCOL mode ) ;
25116 // *****************************************************************************
25117 // *****************************************************************************
25118 // Section: SPI Peripheral Library Exists Functions
25119 // *****************************************************************************
25120 // *****************************************************************************
25121 /* The following functions indicate the existence of the features on the device.
25122 */
25123 //******************************************************************************
25124 /* Function:
25125  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25126  Summary:
25127  Identifies whether the EnableControl feature exists on the SPI module.
25128  Description:
25129  This function identifies whether the EnableControl feature is available on
25130  the SPI module.
25131  When this function returns true, these functions are supported on the device:
25132  - PLIB_SPI_Enable
25133  - PLIB_SPI_Disable
25134  This operation is atomic.
25135  Preconditions:
25136  None.
25137  Parameters:
25138  index - Identifier for the device instance
25139  Returns:
25140  - true - The EnableControl feature is supported on the device
25141  - false - The EnableControl feature is not supported on the device
25142  Remarks:
25143  None.
25144 */
25145 
25146 bool
25148  SPI_MODULE_ID index ) ;
25149 //******************************************************************************
25150 /* Function:
25151  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25152  Summary:
25153  Identifies whether the StopInIdle feature exists on the SPI module.
25154  Description:
25155  This function identifies whether the StopInIdle feature is available on the
25156  SPI module.
25157  When this function returns true, these functions are supported on the device:
25158  - PLIB_SPI_StopInIdleEnable
25159  - PLIB_SPI_StopInIdleDisable
25160  This operation is atomic.
25161  Preconditions:
25162  None.
25163  Parameters:
25164  index - Identifier for the device instance
25165  Returns:
25166  - true - The StopInIdle feature is supported on the device
25167  - false - The StopInIdle feature is not supported on the device
25168  Remarks:
25169  None.
25170 */
25171 
25172 bool
25174  SPI_MODULE_ID index ) ;
25175 //******************************************************************************
25176 /* Function:
25177  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25178  Summary:
25179  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25180  Description:
25181  This function identifies whether the ReceiverOverflow feature is available
25182  on the SPI module.
25183  When this function returns true, these functions are supported on the device:
25184  - PLIB_SPI_ReceiverHasOverflowed
25185  - PLIB_SPI_ReceiverOverflowClear
25186  This operation is atomic.
25187  Preconditions:
25188  None.
25189  Parameters:
25190  index - Identifier for the device instance
25191  Returns:
25192  - true - The ReceiverOverflow feature is supported on the device
25193  - false - The ReceiverOverflow feature is not supported on the device
25194  Remarks:
25195  None.
25196 */
25197 
25198 bool
25200  SPI_MODULE_ID index ) ;
25201 //******************************************************************************
25202 /* Function:
25203  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25204  Summary:
25205  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25206  Description:
25207  This function identifies whether the TransmitBufferFullStatus feature is available
25208  on the SPI module.
25209  When this function returns true, this function is supported on the device:
25210  - PLIB_SPI_TransmitBufferIsFull
25211  This operation is atomic.
25212  Preconditions:
25213  None.
25214  Parameters:
25215  index - Identifier for the device instance
25216  Returns:
25217  - true - The TransmitBufferFullStatus feature is supported on the device
25218  - false - The TransmitBufferFullStatus feature is not supported on the device
25219  Remarks:
25220  None.
25221 */
25222 
25223 bool
25225  SPI_MODULE_ID index ) ;
25226 //******************************************************************************
25227 /* Function:
25228  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25229  Summary:
25230  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25231  Description:
25232  This function identifies whether the TransmitBufferEmptyStatus feature is available
25233  on the SPI module.
25234  When this function returns true, this function is supported on the device:
25235  - PLIB_SPI_TransmitBufferIsEmpty
25236  This operation is atomic.
25237  Preconditions:
25238  None.
25239  Parameters:
25240  index - Identifier for the device instance
25241  Returns:
25242  - true - The TransmitBufferEmptyStatus feature is supported on the device
25243  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25244  Remarks:
25245  None.
25246 */
25247 
25248 bool
25250  SPI_MODULE_ID index ) ;
25251 //******************************************************************************
25252 /* Function:
25253  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25254  Summary:
25255  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25256  Description:
25257  This function identifies whether the ReceiveBufferStatus feature is available
25258  on the SPI module.
25259  When this function returns true, this function is supported on the device:
25260  - PLIB_SPI_ReceiverBufferIsFull
25261  This operation is atomic.
25262  Preconditions:
25263  None.
25264  Parameters:
25265  index - Identifier for the device instance
25266  Returns:
25267  - true - The ReceiveBufferStatus feature is supported on the device
25268  - false - The ReceiveBufferStatus feature is not supported on the device
25269  Remarks:
25270  None.
25271 */
25272 
25273 bool
25275  SPI_MODULE_ID index ) ;
25276 //******************************************************************************
25277 /* Function:
25278  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25279  Summary:
25280  Identifies whether the PinControl feature exists on the SPI module.
25281  Description:
25282  This function identifies whether the PinControl feature is available on the
25283  SPI module.
25284  When this function returns true, these functions are supported on the device:
25285  - PLIB_SPI_PinEnable
25286  - PLIB_SPI_PinDisable
25287  This operation is atomic.
25288  Preconditions:
25289  None.
25290  Parameters:
25291  index - Identifier for the device instance
25292  Returns:
25293  - true - The PinControl feature is supported on the device
25294  - false - The PinControl feature is not supported on the device
25295  Remarks:
25296  None.
25297 */
25298 
25299 bool
25301  SPI_MODULE_ID index ) ;
25302 //******************************************************************************
25303 /* Function:
25304  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25305  Summary:
25306  Identifies whether the CommunicationWidth feature exists on the SPI module.
25307  Description:
25308  This function identifies whether the CommunicationWidth feature is available
25309  on the SPI module.
25310  When this function returns true, this function is supported on the device:
25311  - PLIB_SPI_CommunicationWidthSelect
25312  This operation is atomic.
25313  Preconditions:
25314  None.
25315  Parameters:
25316  index - Identifier for the device instance
25317  Returns:
25318  - true - The CommunicationWidth feature is supported on the device
25319  - false - The CommunicationWidth feature is not supported on the device
25320  Remarks:
25321  None.
25322 */
25323 
25324 bool
25326  SPI_MODULE_ID index ) ;
25327 //******************************************************************************
25328 /* Function:
25329  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25330  Summary:
25331  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25332  Description:
25333  This function identifies whether the AudioCommunicationWidth feature is available
25334  on the SPI module.
25335  When this function returns true, this function is supported on the device:
25336  - PLIB_SPI_AudioCommunicationWidthSelect
25337  This operation is atomic.
25338  Preconditions:
25339  None.
25340  Parameters:
25341  index - Identifier for the device instance
25342  Returns:
25343  - true - The AudioCommunicationWidth feature is supported on the device
25344  - false - The AudioCommunicationWidth feature is not supported on the device
25345  Remarks:
25346  None.
25347 */
25348 
25349 bool
25351  SPI_MODULE_ID index ) ;
25352 //******************************************************************************
25353 /* Function:
25354  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25355  Summary:
25356  Identifies whether the InputSamplePhase feature exists on the SPI module.
25357  Description:
25358  This function identifies whether the InputSamplePhase feature is available
25359  on the SPI module.
25360  When this function returns true, this function is supported on the device:
25361  - PLIB_SPI_InputSamplePhaseSelect
25362  This operation is atomic.
25363  Preconditions:
25364  None.
25365  Parameters:
25366  index - Identifier for the device instance
25367  Returns:
25368  - true - The InputSamplePhase feature is supported on the device
25369  - false - The InputSamplePhase feature is not supported on the device
25370  Remarks:
25371  None.
25372 */
25373 
25374 bool
25376  SPI_MODULE_ID index ) ;
25377 //******************************************************************************
25378 /* Function:
25379  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25380  Summary:
25381  Identifies whether the OutputDataPhase feature exists on the SPI module.
25382  Description:
25383  This function identifies whether the OutputDataPhase feature is available on
25384  the SPI module.
25385  When this function returns true, this function is supported on the device:
25386  - PLIB_SPI_OutputDataPhaseSelect
25387  This operation is atomic.
25388  Preconditions:
25389  None.
25390  Parameters:
25391  index - Identifier for the device instance
25392  Returns:
25393  - true - The OutputDataPhase feature is supported on the device
25394  - false - The OutputDataPhase feature is not supported on the device
25395  Remarks:
25396  None.
25397 */
25398 
25399 bool
25401  SPI_MODULE_ID index ) ;
25402 //******************************************************************************
25403 /* Function:
25404  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25405  Summary:
25406  Identifies whether the ClockPolarity feature exists on the SPI module.
25407  Description:
25408  This function identifies whether the ClockPolarity feature is available on
25409  the SPI module.
25410  When this function returns true, this function is supported on the device:
25411  - PLIB_SPI_ClockPolaritySelect
25412  This operation is atomic.
25413  Preconditions:
25414  None.
25415  Parameters:
25416  index - Identifier for the device instance
25417  Returns:
25418  - true - The ClockPolarity feature is supported on the device
25419  - false - The ClockPolarity feature is not supported on the device
25420  Remarks:
25421  None.
25422 */
25423 
25424 bool
25426  SPI_MODULE_ID index ) ;
25427 //******************************************************************************
25428 /* Function:
25429  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25430  Summary:
25431  Identifies whether the MasterControl feature exists on the SPI module.
25432  Description:
25433  This function identifies whether the MasterControl feature is available on
25434  the SPI module.
25435  When this function returns true, these functions are supported on the device:
25436  - PLIB_SPI_MasterEnable
25437  - PLIB_SPI_SlaveEnable
25438  This operation is atomic.
25439  Preconditions:
25440  None.
25441  Parameters:
25442  index - Identifier for the device instance
25443  Returns:
25444  - true - The MasterControl feature is supported on the device
25445  - false - The MasterControl feature is not supported on the device
25446  Remarks:
25447  None.
25448 */
25449 
25450 bool
25452  SPI_MODULE_ID index ) ;
25453 //******************************************************************************
25454 /* Function:
25455  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25456  Summary:
25457  Identifies whether the BaudRate feature exists on the SPI module.
25458  Description:
25459  This function identifies whether the BaudRate feature is available on the SPI
25460  module.
25461  When this function returns true, this function is supported on the device:
25462  - PLIB_SPI_BaudRateSet
25463  This operation is atomic.
25464  Preconditions:
25465  None.
25466  Parameters:
25467  index - Identifier for the device instance
25468  Returns:
25469  - true - The BaudRate feature is supported on the device
25470  - false - The BaudRate feature is not supported on the device
25471  Remarks:
25472  None.
25473 */
25474 
25475 bool
25477  SPI_MODULE_ID index ) ;
25478 //******************************************************************************
25479 /* Function:
25480  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25481  Summary:
25482  Identifies whether the BusStatus feature exists on the SPI module.
25483  Description:
25484  This function identifies whether the BusStatus feature is available on the
25485  SPI module.
25486  When this function returns true, this function is supported on the device:
25487  - PLIB_SPI_IsBusy
25488  This operation is atomic.
25489  Preconditions:
25490  None.
25491  Parameters:
25492  index - Identifier for the device instance
25493  Returns:
25494  - true - The BusStatus feature is supported on the device
25495  - false - The BusStatus feature is not supported on the device
25496  Remarks:
25497  None.
25498 */
25499 
25500 bool
25502  SPI_MODULE_ID index ) ;
25503 //******************************************************************************
25504 /* Function:
25505  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25506  Summary:
25507  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25508  Description:
25509  This function identifies whether the ReadDataSignStatus feature is available
25510  on the SPI module.
25511  When this function returns true, this function is supported on the device:
25512  - PLIB_SPI_ReadDataIsSignExtended
25513  This operation is atomic.
25514  Preconditions:
25515  None.
25516  Parameters:
25517  index - Identifier for the device instance
25518  Returns:
25519  - true - The ReadDataSignStatus feature is supported on the device
25520  - false - The ReadDataSignStatus feature is not supported on the device
25521  Remarks:
25522  None.
25523 */
25524 
25525 bool
25527  SPI_MODULE_ID index ) ;
25528 //******************************************************************************
25529 /* Function:
25530  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25531  Summary:
25532  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25533  Description:
25534  This function identifies whether the SlaveSelectControl feature is available
25535  on the SPI module.
25536  When this function returns true, these functions are supported on the device:
25537  - PLIB_SPI_SlaveSelectEnable
25538  - PLIB_SPI_SlaveSelectDisable
25539  This operation is atomic.
25540  Preconditions:
25541  None.
25542  Parameters:
25543  index - Identifier for the device instance
25544  Returns:
25545  - true - The SlaveSelectControl feature is supported on the device
25546  - false - The SlaveSelectControl feature is not supported on the device
25547  Remarks:
25548  None.
25549 */
25550 
25551 bool
25553  SPI_MODULE_ID index ) ;
25554 //******************************************************************************
25555 /* Function:
25556  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25557  Summary:
25558  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25559  Description:
25560  This function identifies whether the TransmitUnderRunStatus feature is available
25561  on the SPI module.
25562  When this function returns true, these functions are supported on the device:
25563  - PLIB_SPI_TransmitUnderRunStatusGet
25564  - PLIB_SPI_TransmitUnderRunStatusClear
25565  This operation is atomic.
25566  Preconditions:
25567  None.
25568  Parameters:
25569  index - Identifier for the device instance
25570  Returns:
25571  - true - The TransmitUnderRunStatus feature is supported on the device
25572  - false - The TransmitUnderRunStatus feature is not supported on the device
25573  Remarks:
25574  None.
25575 */
25576 
25577 bool
25579  SPI_MODULE_ID index ) ;
25580 //******************************************************************************
25581 /* Function:
25582  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25583  Summary:
25584  Identifies whether the FIFOControl feature exists on the SPI module.
25585  Description:
25586  This function identifies whether the FIFOControl feature is available on the
25587  SPI module.
25588  When this function returns true, these functions are supported on the device:
25589  - PLIB_SPI_FIFOEnable
25590  - PLIB_SPI_FIFODisable
25591  This operation is atomic.
25592  Preconditions:
25593  None.
25594  Parameters:
25595  index - Identifier for the device instance
25596  Returns:
25597  - true - The FIFOControl feature is supported on the device
25598  - false - The FIFOControl feature is not supported on the device
25599  Remarks:
25600  None.
25601 */
25602 
25603 bool
25605  SPI_MODULE_ID index ) ;
25606 //******************************************************************************
25607 /* Function:
25608  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25609  Summary:
25610  Identifies whether the FIFOCount feature exists on the SPI module.
25611  Description:
25612  This function identifies whether the FIFOCount feature is available on the SPI module.
25613  When this function returns true, this function is supported on the device:
25614  - PLIB_SPI_FIFOCountGet
25615  This operation is atomic.
25616  Preconditions:
25617  None.
25618  Parameters:
25619  index - Identifier for the device instance
25620  Returns:
25621  - true - The FIFOCount feature is supported on the device
25622  - false - The FIFOCount feature is not supported on the device
25623  Remarks:
25624  None.
25625 */
25626 
25627 bool
25629  SPI_MODULE_ID index ) ;
25630 //******************************************************************************
25631 /* Function:
25632  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25633  Summary:
25634  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25635  Description:
25636  This function identifies whether the ReceiveFIFOStatus feature is available
25637  on the SPI module.
25638  When this function returns true, this function is supported on the device:
25639  - PLIB_SPI_ReceiverFIFOIsEmpty
25640  This operation is atomic.
25641  Preconditions:
25642  None.
25643  Parameters:
25644  index - Identifier for the device instance
25645  Returns:
25646  - true - The ReceiveFIFOStatus feature is supported on the device
25647  - false - The ReceiveFIFOStatus feature is not supported on the device
25648  Remarks:
25649  None.
25650 */
25651 
25652 bool
25654  SPI_MODULE_ID index ) ;
25655 //******************************************************************************
25656 /* Function:
25657  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25658  Summary:
25659  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25660  Description:
25661  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25662  available on the SPI module.
25663  When this function returns true, this function is supported on the device:
25664  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25665  This operation is atomic.
25666  Preconditions:
25667  None.
25668  Parameters:
25669  index - Identifier for the device instance
25670  Returns:
25671  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25672  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25673  Remarks:
25674  None.
25675 */
25676 
25677 bool
25679  SPI_MODULE_ID index ) ;
25680 //******************************************************************************
25681 /* Function:
25682  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25683  Summary:
25684  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25685  Description:
25686  This function identifies whether the FIFOInterruptMode feature is available
25687  on the SPI module.
25688  When this function returns true, this function is supported on the device:
25689  - PLIB_SPI_FIFOInterruptModeSelect
25690  This operation is atomic.
25691  Preconditions:
25692  None.
25693  Parameters:
25694  index - Identifier for the device instance
25695  Returns:
25696  - true - The FIFOInterruptMode feature is supported on the device
25697  - false - The FIFOInterruptMode feature is not supported on the device
25698  Remarks:
25699  None.
25700 */
25701 
25702 bool
25704  SPI_MODULE_ID index ) ;
25705 //******************************************************************************
25706 /* Function:
25707  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25708  Summary:
25709  Identifies whether the FramedCommunication feature exists on the SPI module.
25710  Description:
25711  This function identifies whether the FramedCommunication feature is available
25712  on the SPI module.
25713  When this function returns true, these functions are supported on the device:
25714  - PLIB_SPI_FramedCommunicationEnable
25715  - PLIB_SPI_FramedCommunicationDisable
25716  This operation is atomic.
25717  Preconditions:
25718  None.
25719  Parameters:
25720  index - Identifier for the device instance
25721  Returns:
25722  - true - The FramedCommunication feature is supported on the device
25723  - false - The FramedCommunication feature is not supported on the device
25724  Remarks:
25725  None.
25726 */
25727 
25728 bool
25730  SPI_MODULE_ID index ) ;
25731 //******************************************************************************
25732 /* Function:
25733  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25734  Summary:
25735  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25736  Description:
25737  This function identifies whether the FrameSyncPulseDirection feature is available
25738  on the SPI module.
25739  When this function returns true, this function is supported on the device:
25740  - PLIB_SPI_FrameSyncPulseDirectionSelect
25741  This operation is atomic.
25742  Preconditions:
25743  None.
25744  Parameters:
25745  index - Identifier for the device instance
25746  Returns:
25747  - true - The FrameSyncPulseDirection feature is supported on the device
25748  - false - The FrameSyncPulseDirection feature is not supported on the device
25749  Remarks:
25750  None.
25751 */
25752 
25753 bool
25755  SPI_MODULE_ID index ) ;
25756 //******************************************************************************
25757 /* Function:
25758  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25759  Summary:
25760  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25761  Description:
25762  This function identifies whether the FrameSyncPulsePolarity feature is available
25763  on the SPI module.
25764  When this function returns true, this function is supported on the device:
25765  - PLIB_SPI_FrameSyncPulsePolaritySelect
25766  This operation is atomic.
25767  Preconditions:
25768  None.
25769  Parameters:
25770  index - Identifier for the device instance
25771  Returns:
25772  - true - The FrameSyncPulsePolarity feature is supported on the device
25773  - false - The FrameSyncPulsePolarity feature is not supported on the device
25774  Remarks:
25775  None.
25776 */
25777 
25778 bool
25780  SPI_MODULE_ID index ) ;
25781 //******************************************************************************
25782 /* Function:
25783  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25784  Summary:
25785  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25786  Description:
25787  This function identifies whether the FrameSyncPulseEdge feature is available
25788  on the SPI module.
25789  When this function returns true, this function is supported on the device:
25790  - PLIB_SPI_FrameSyncPulseEdgeSelect
25791  This operation is atomic.
25792  Preconditions:
25793  None.
25794  Parameters:
25795  index - Identifier for the device instance
25796  Returns:
25797  - true - The FrameSyncPulseEdge feature is supported on the device
25798  - false - The FrameSyncPulseEdge feature is not supported on the device
25799  Remarks:
25800  None.
25801 */
25802 
25803 bool
25805  SPI_MODULE_ID index ) ;
25806 //******************************************************************************
25807 /* Function:
25808  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25809  Summary:
25810  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25811  Description:
25812  This function identifies whether the FrameSyncPulseWidth feature is available
25813  on the SPI module.
25814  When this function returns true, this function is supported on the device:
25815  - PLIB_SPI_FrameSyncPulseWidthSelect
25816  This operation is atomic.
25817  Preconditions:
25818  None.
25819  Parameters:
25820  index - Identifier for the device instance
25821  Returns:
25822  - true - The FrameSyncPulseWidth feature is supported on the device
25823  - false - The FrameSyncPulseWidth feature is not supported on the device
25824  Remarks:
25825  None.
25826 */
25827 
25828 bool
25830  SPI_MODULE_ID index ) ;
25831 //******************************************************************************
25832 /* Function:
25833  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25834  Summary:
25835  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25836  Description:
25837  This function identifies whether the FrameSyncPulseCounter feature is available
25838  on the SPI module.
25839  When this function returns true, this function is supported on the device:
25840  - PLIB_SPI_FrameSyncPulseCounterSelect
25841  This operation is atomic.
25842  Preconditions:
25843  None.
25844  Parameters:
25845  index - Identifier for the device instance
25846  Returns:
25847  - true - The FrameSyncPulseCounter feature is supported on the device
25848  - false - The FrameSyncPulseCounter feature is not supported on the device
25849  Remarks:
25850  None.
25851 */
25852 
25853 bool
25855  SPI_MODULE_ID index ) ;
25856 //******************************************************************************
25857 /* Function:
25858  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25859  Summary:
25860  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25861  Description:
25862  This function identifies whether the FrameErrorStatus feature is available on
25863  the SPI module.
25864  When this function returns true, these functions are supported on the device:
25865  - PLIB_SPI_FrameErrorStatusGet
25866  - PLIB_SPI_FrameErrorStatusClear
25867  This operation is atomic.
25868  Preconditions:
25869  None.
25870  Parameters:
25871  index - Identifier for the device instance
25872  Returns:
25873  - true - The FrameErrorStatus feature is supported on the device
25874  - false - The FrameErrorStatus feature is not supported on the device
25875  Remarks:
25876  None.
25877 */
25878 
25879 bool
25881  SPI_MODULE_ID index ) ;
25882 //******************************************************************************
25883 /* Function:
25884  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25885  Summary:
25886  Identifies whether the Buffer feature exists on the SPI module.
25887  Description:
25888  This function identifies whether the Buffer feature is available on the SPI module.
25889  When this function returns true, these functions are supported on the device:
25890  - PLIB_SPI_BufferClear
25891  - PLIB_SPI_BufferRead
25892  - PLIB_SPI_BufferWrite
25893  - PLIB_SPI_BufferAddressGet
25894  This operation is atomic.
25895  Preconditions:
25896  None.
25897  Parameters:
25898  index - Identifier for the device instance
25899  Returns:
25900  - true - The Buffer feature is supported on the device
25901  - false - The Buffer feature is not supported on the device
25902  Remarks:
25903  None.
25904 */
25905 
25906 bool
25908  SPI_MODULE_ID index ) ;
25909 //******************************************************************************
25910 /* Function:
25911  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25912  Summary:
25913  Identifies whether the BaudRateClock feature exists on the SPI module.
25914  Description:
25915  This function identifies whether the BaudRateClock feature is available on
25916  the SPI module.
25917  When this function returns true, this function is supported on the device:
25918  - PLIB_SPI_BaudRateClockSelect
25919  This operation is atomic.
25920  Preconditions:
25921  None.
25922  Parameters:
25923  index - Identifier for the device instance
25924  Returns:
25925  - true - The BaudRateClock feature is supported on the device
25926  - false - The BaudRateClock feature is not supported on the device
25927  Remarks:
25928  None.
25929 */
25930 
25931 bool
25933  SPI_MODULE_ID index ) ;
25934 //******************************************************************************
25935 /* Function:
25936  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25937  Summary:
25938  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25939  Description:
25940  This function identifies whether the ErrorInterruptControl feature is available
25941  on the SPI module.
25942  When this function returns true, these functions are supported on the device:
25943  - PLIB_SPI_ErrorInterruptEnable
25944  - PLIB_SPI_ErrorInterruptDisable
25945  This operation is atomic.
25946  Preconditions:
25947  None.
25948  Parameters:
25949  index - Identifier for the device instance
25950  Returns:
25951  - true - The ErrorInterruptControl feature is supported on the device
25952  - false - The ErrorInterruptControl feature is not supported on the device
25953  Remarks:
25954  None.
25955 */
25956 
25957 bool
25959  SPI_MODULE_ID index ) ;
25960 //******************************************************************************
25961 /* Function:
25962  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25963  Summary:
25964  Identifies whether the AudioErrorControl feature exists on the SPI module.
25965  Description:
25966  This function identifies whether the AudioErrorControl feature is available
25967  on the SPI module.
25968  When this function returns true, these functions are supported on the device:
25969  - PLIB_SPI_AudioErrorEnable
25970  - PLIB_SPI_AudioErrorDisable
25971  This operation is atomic.
25972  Preconditions:
25973  None.
25974  Parameters:
25975  index - Identifier for the device instance
25976  Returns:
25977  - true - The AudioErrorControl feature is supported on the device
25978  - false - The AudioErrorControl feature is not supported on the device
25979  Remarks:
25980  None.
25981 */
25982 
25983 bool
25985  SPI_MODULE_ID index ) ;
25986 //******************************************************************************
25987 /* Function:
25988  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25989  Summary:
25990  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25991  Description:
25992  This function identifies whether the AudioProtocolControl feature is available
25993  on the SPI module.
25994  When this function returns true, this function is supported on the device:
25995  - PLIB_SPI_AudioProtocolEnable
25996  - PLIB_SPI_AudioProtocolDisable
25997  This operation is atomic.
25998  Preconditions:
25999  None.
26000  Parameters:
26001  index - Identifier for the device instance
26002  Returns:
26003  - true - The AudioProtocolControl feature is supported on the device
26004  - false - The AudioProtocolControl feature is not supported on the device
26005  Remarks:
26006  None.
26007 */
26008 
26009 bool
26011  SPI_MODULE_ID index ) ;
26012 //******************************************************************************
26013 /* Function:
26014  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26015  Summary:
26016  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26017  Description:
26018  This function identifies whether the AudioTransmitMode feature is available
26019  on the SPI module.
26020  When this function returns true, this function is supported on the device:
26021  - PLIB_SPI_AudioTransmitModeSelect
26022  This operation is atomic.
26023  Preconditions:
26024  None.
26025  Parameters:
26026  index - Identifier for the device instance
26027  Returns:
26028  - true - The AudioTransmitMode feature is supported on the device
26029  - false - The AudioTransmitMode feature is not supported on the device
26030  Remarks:
26031  None.
26032 */
26033 
26034 bool
26036  SPI_MODULE_ID index ) ;
26037 //******************************************************************************
26038 /* Function:
26039  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26040  Summary:
26041  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26042  Description:
26043  This function identifies whether the AudioProtocolMode feature is available
26044  on the SPI module.
26045  When this function returns true, this function is supported on the device:
26046  - PLIB_SPI_AudioProtocolModeSelect
26047  This operation is atomic.
26048  Preconditions:
26049  None.
26050  Parameters:
26051  index - Identifier for the device instance
26052  Returns:
26053  - true - The AudioProtocolMode feature is supported on the device
26054  - false - The AudioProtocolMode feature is not supported on the device
26055  Remarks:
26056  None.
26057 */
26058 
26059 bool
26061  SPI_MODULE_ID index ) ;
26062 //******************************************************************************
26063 /* Function:
26064  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26065  Summary:
26066  Identifies whether the Buffer32bit feature exists on the SPI module.
26067  Description:
26068  This function identifies whether the Buffer32bit feature is available on the
26069  SPI module.
26070  When this function returns true, these functions are supported on the device:
26071  - PLIB_SPI_BufferRead32bit
26072  - PLIB_SPI_BufferWrite32bit
26073  This operation is atomic.
26074  Preconditions:
26075  None.
26076  Parameters:
26077  index - Identifier for the device instance
26078  Returns:
26079  - true - The Buffer32bit feature is supported on the device
26080  - false - The Buffer32bit feature is not supported on the device
26081  Remarks:
26082  None.
26083 */
26084 
26085 bool
26087  SPI_MODULE_ID index ) ;
26088 //******************************************************************************
26089 /* Function:
26090  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26091  Summary:
26092  Identifies whether the Buffer16bit feature exists on the SPI module.
26093  Description:
26094  This function identifies whether the Buffer16bit feature is available on the
26095  SPI module.
26096  When this function returns true, these functions are supported on the device:
26097  - PLIB_SPI_BufferRead16bit
26098  - PLIB_SPI_BufferWrite16bit
26099  This operation is atomic.
26100  Preconditions:
26101  None.
26102  Parameters:
26103  index - Identifier for the device instance
26104  Returns:
26105  - true - The Buffer16bit feature is supported on the device
26106  - false - The Buffer16bit feature is not supported on the device
26107  Remarks:
26108  None.
26109 */
26110 
26111 bool
26113  SPI_MODULE_ID index ) ;
26114 //DOM-IGNORE-BEGIN
26115 //DOM-IGNORE-END
26116  // #ifndef _PLIB_SPI_H
26117 /*******************************************************************************
26118  End of File
26119  */
26120 
26121 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26122 /* CLOSE_FILE Include File */
26123 
26124  // SPI PLIB Header
26125 #include "system/common/sys_common.h" // Common System Service Definitions
26126 #include "system/common/sys_module.h" // Module/Driver Definitions
26127 #include "system/int/sys_int.h" // System Interrupt Definitions
26128 #include "system/clk/sys_clk.h"
26129 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26130  /* LDRA full path */
26131 // DOM-IGNORE-BEGIN
26132 // DOM-IGNORE-END
26133 // *****************************************************************************
26134 /* SPI Driver Buffer Handle
26135  Summary:
26136  Handle identifying a read or write buffer passed to the driver.
26137  Description:
26138  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26139  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26140  This handle is associated with the buffer passed into the function and
26141  it allows the application to track the completion of the data from (or into)
26142  that buffer. The buffer handle value returned from the "buffer add" function
26143  is returned back to the client by the "callback" function registered with
26144  the driver.
26145  The buffer handle assigned to a client request expires when the client has
26146  been notified of the completion of the buffer transfer (after event handler
26147  function that notifies the client returns) or after the buffer has been
26148  retired by the driver if no event handler callback was set.
26149  Remarks:
26150  None.
26151 */
26152 
26153 typedef
26154 uintptr_t
26156 // *****************************************************************************
26157 /* SPI Driver Invalid Buffer Handle
26158  Summary:
26159  Definition of an invalid buffer handle.
26160  Description:
26161  This is the definition of an invalid buffer handle. An invalid buffer handle
26162  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26163  function if the buffer add request was not successful.
26164  Remarks:
26165  None.
26166 */
26167 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26168 // *****************************************************************************
26169 /* SPI Driver Module Index Numbers
26170  Summary:
26171  SPI driver index definitions.
26172  Description:
26173  These constants provide the SPI driver index definitions.
26174  Remarks:
26175  These constants should be used in place of hard-coded numeric literals.
26176  These values should be passed into the DRV_SPI_Initialize and
26177  DRV_SPI_Open functions to identify the driver instance in use.
26178 */
26179 #define DRV_SPI_INDEX_0 0
26180 #define DRV_SPI_INDEX_1 1
26181 #define DRV_SPI_INDEX_2 2
26182 #define DRV_SPI_INDEX_3 3
26183 #define DRV_SPI_INDEX_4 4
26184 #define DRV_SPI_INDEX_5 5
26185 // *****************************************************************************
26186 /* SPI Driver Module Index Count
26187  Summary:
26188  Number of valid SPI driver indices.
26189  Description:
26190  This constant identifies the number of valid SPI driver indices.
26191  Remarks:
26192  This constant should be used in place of hard-coded numeric literals.
26193  This value is derived from device-specific header files defined as part
26194  of the peripheral libraries.
26195 */
26196 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26197 // *****************************************************************************
26198 /* SPI Clock Mode Selection
26199  Summary:
26200  Identifies the various clock modes of the SPI module.
26201  Description:
26202  This enumeration identifies the various clock modes of the SPI module.
26203  Remarks:
26204  None.
26205 */
26206 
26207 typedef
26208  enum
26209  {
26210  /* SPI Clock Mode 0:
26211  - Idle State of the clock is Low
26212  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26213  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26215  /*DOM-IGNORE-BEGIN*/
26216  = 0 /*DOM-IGNORE-END*/
26217  ,
26218  /* SPI Clock Mode 1:
26219  - Idle State of the clock is Low
26220  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26221  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26223  /*DOM-IGNORE-BEGIN*/
26224  = 1 /*DOM-IGNORE-END*/
26225  ,
26226  /* SPI Clock Mode 2:
26227  - Idle State of the clock is High
26228  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26229  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26231  /*DOM-IGNORE-BEGIN*/
26232  = 2 /*DOM-IGNORE-END*/
26233  ,
26234  /* SPI Clock Mode 3:
26235  - Idle State of the clock is High
26236  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26237  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26239  /*DOM-IGNORE-BEGIN*/
26240  = 3 /*DOM-IGNORE-END*/
26241  } DRV_SPI_CLOCK_MODE ;
26242 // *****************************************************************************
26243 /* SPI Buffer Type Selection
26244  Summary:
26245  Identifies the various buffer types of the SPI module.
26246  Description:
26247  This enumeration identifies the various buffer types of the SPI module.
26248  Remarks:
26249  None.
26250 */
26251 
26252 typedef
26253  enum
26254  {
26255  /* SPI Buffer Type Standard */
26257  /*DOM-IGNORE-BEGIN*/
26258  = 0 /*DOM-IGNORE-END*/
26259  ,
26260  /* SPI Enhanced Buffer Type */
26262  /*DOM-IGNORE-BEGIN*/
26263  = 1 /*DOM-IGNORE-END*/
26265 // *****************************************************************************
26266 /* SPI Protocols Enumeration
26267  Summary:
26268  Identifies the various protocols of the SPI module.
26269  Description:
26270  This enumeration identifies the various protocols of the SPI module.
26271  Remarks:
26272  None.
26273 */
26274 
26275 typedef
26276  enum
26277  {
26278  /* SPI Protocol Type Standard */
26280  /*DOM-IGNORE-BEGIN*/
26281  = 0 /*DOM-IGNORE-END*/
26282  ,
26283  /* SPI Protocol Type Framed */
26285  /*DOM-IGNORE-BEGIN*/
26286  = 1 /*DOM-IGNORE-END*/
26287  ,
26288  /*SPI Protocol Type Audio*/
26290  /*DOM-IGNORE-BEGIN*/
26291  = 2 /*DOM-IGNORE-END*/
26293 // *****************************************************************************
26294 /* SPI Driver Buffer Events
26295  Summary
26296  Identifies the possible events that can result from a buffer add request.
26297  Description
26298  This enumeration identifies the possible events that can result from a
26299  buffer add request caused by the client calling either
26300  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26301  Remarks:
26302  One of these values is passed in the "event" parameter of the event
26303  handling callback function that the client registered during buffer add
26304  requests.
26305 */
26306 
26307 typedef
26308  enum
26309  {
26310  /* Buffer is pending to get processed */
26312  /* Buffer is being processed */
26314  /* All data from or to the buffer was transferred successfully. */
26316  /* There was an error while processing the buffer transfer request. */
26319 // *****************************************************************************
26320 /* SPI Usage Modes Enumeration
26321  Summary:
26322  Identifies the various usage modes of the SPI module.
26323  Description:
26324  This enumeration identifies the various usage modes of the SPI module.
26325  Remarks:
26326  None.
26327 */
26328 
26329 typedef
26330  enum
26331  {
26332  /* SPI Mode Master */
26334  /*DOM-IGNORE-BEGIN*/
26335  = 0 /*DOM-IGNORE-END*/
26336  ,
26337  /* SPI Mode Slave */
26339  /*DOM-IGNORE-BEGIN*/
26340  = 1 /*DOM-IGNORE-END*/
26341  } DRV_SPI_MODE ;
26342 // *****************************************************************************
26343 /* SPI Task Modes Enumeration
26344  Summary:
26345  Identifies the various modes of how the tasks function will be run.
26346  Description:
26347  This enumeration identifies the various tasks mode
26348  Remarks:
26349  None.
26350 */
26351 
26352 typedef
26353  enum
26354  {
26355  /* Task is configured to run in polled mode */
26357  /*DOM-IGNORE-BEGIN*/
26358  = 0 /*DOM-IGNORE-END*/
26359  ,
26360  /* Task is configured to run in interrupt mode */
26362  /*DOM-IGNORE-BEGIN*/
26363  = 1 /*DOM-IGNORE-END*/
26364  } DRV_SPI_TASK_MODE ;
26365 // *****************************************************************************
26366 /* SPI Driver Buffer Event Handler Function Pointer
26367  Summary:
26368  Pointer to a SPI Driver Buffer Event handler function
26369  Description:
26370  This data type defines the required function signature for the SPI driver
26371  buffer event handling callback function. A client must register a pointer
26372  to a buffer event handling function who's function signature (parameter
26373  and return value types) match the types specified by this function pointer
26374  in order to receive buffer related event calls back from the driver.
26375  The parameters and return values and return value are described here and
26376  a partial example implementation is provided.
26377  Parameters:
26378  event - Identifies the type of event
26379  bufferHandle - Handle identifying the buffer to which the vent relates
26380  context - Value identifying the context of the application that
26381  registered the event handling function.
26382  Returns:
26383  None.
26384  Example:
26385  <code>
26386  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26387  DRV_SPI_BUFFER_HANDLE bufferHandle,
26388  uintptr_t context )
26389  {
26390  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26391  switch(event)
26392  {
26393  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26394  // Handle the completed buffer.
26395  break;
26396  case DRV_SPI_BUFFER_EVENT_ERROR:
26397  default:
26398  // Handle error.
26399  break;
26400  }
26401  }
26402  </code>
26403  Remarks:
26404  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26405  transferred successfully.
26406  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26407  not transferred successfully.
26408  The bufferHandle parameter contains the buffer handle of the buffer that
26409  failed.
26410  The context parameter contains the a handle to the client context,
26411  provided at the time the event handling function registration.
26412  This context handle value is passed back to the client as the "context"
26413  parameter. It can be any value necessary to identify the client context
26414  or instance (such as a pointer to the client's data) instance of the
26415  client that made the buffer add request.
26416  The event handler function executes in an interrupt context when the driver
26417  is configured for interrupt mode operation. It is recommended of the
26418  application to not perform process intensive operations with in this
26419  function.
26420 */
26421 
26422 typedef
26424 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26425 void * context ) ;
26426 // *****************************************************************************
26427 /* SPI Driver Initialization Data
26428  Summary:
26429  Defines the data required to initialize or reinitialize the SPI driver
26430  Description:
26431  This data type defines the data required to initialize or reinitialize the
26432  SPI driver. If the driver is built statically, the members of this data
26433  structure are statically over-ridden by static override definitions in the
26434  system_config.h file.
26435  Remarks:
26436  None.
26437 */
26438 
26439 typedef
26440 struct _DRV_SPI_INIT
26441 {
26442  /* System module initialization */
26443  SYS_MODULE_INIT moduleInit ;
26444  /* Identifies peripheral (PLIB-level) ID */
26445  SPI_MODULE_ID spiId ;
26446  /* SPI Task Mode Type*/
26448  /* SPI Usage Mode Type */
26450  /* Allow SPI to run when CPU goes to idle mode*/
26451  bool allowIdleRun ;
26452  /* SPI Protocol Type */
26454  /* SPI Slave Mode SSx Pin Select */
26455  bool spiSlaveSSPin ;
26456  /* Framed mode Sync Pulse*/
26457  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26458  /* Framed Mode pulse polarity*/
26459  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26460  /* Framed Mode Pulse Direction*/
26461  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26462  /* Framed mode Pulse Edge*/
26463  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26464  /* Framed Mode Pulse width */
26465  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26466  /* Audio mode transmit mode*/
26467  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26468  /* Audio mode protocol mode*/
26469  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26470  /* Communication Width */
26471  SPI_COMMUNICATION_WIDTH commWidth ;
26472  /* SPI clock source which generates required baud rate.
26473  It can be either PBCLK or Reference Clock */
26474  SPI_BAUD_RATE_CLOCK baudClockSource ;
26475  /* when Baud rate clock source is peripheral clock, then this element is
26476  used to define which peripheral bus clock is used for this particular
26477  SPI instance. */
26478  CLK_BUSES_PERIPHERAL spiClk ;
26479  /* Baud Rate Value */
26480  uint32_t baudRate ;
26481  /* SPI Buffer Type */
26483  /* SPI Clock mode */
26485  /* SPI Input Sample Phase Selection */
26486  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26487  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26488  INT_SOURCE txInterruptSource ;
26489  /* Receive Interrupt Source for SPI module */
26490  INT_SOURCE rxInterruptSource ;
26491  /* Error Interrupt Source for SPI module */
26492  INT_SOURCE errInterruptSource ;
26493  /* While using standard buffer and polled mode how many transfers to do
26494  before yielding to other tasks*/
26495  uint8_t numTrfsSmPolled ;
26496  /* Dummy byte value which will be used for dummy transmission */
26497  uint32_t dummyByteValue ;
26498  /* This is the buffer queue size. This is the maximum
26499  number of transfer requests that driver will queue. */
26500  uint8_t queueSize ;
26501  /* This controls the minimum number of jobs that the driver will be able
26502  to accept without running out of memory. The driver will reserve this
26503  number of jobs from the global SPI queue so that it will always be available*/
26504  uint8_t jobQueueReserveSize ;
26505  /* This callback is fired when an operation is about to start on the
26506  SPI bus. This allows the user to set any pins that need to be set.
26507  This callback may be called from an ISR so should not include OSAL
26508  calls. The context parameter is the same one passed into the
26509  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26510  */
26512  /* This callback is fired when an operation has just completed on the
26513  SPI bus. This allows the user to set any pins that need to be set.
26514  This callback may be called from an ISR so should not include OSAL
26515  calls. The context parameter is the same one passed into the
26516  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26517  */
26519 } DRV_SPI_INIT ;
26520 // *****************************************************************************
26521 /* SPI Driver Client Specific Configuration
26522  Summary:
26523  Defines the data that can be changed per client.
26524  Description:
26525  This data type defines the data can be configured per client. This data can
26526  be per client, and overrides the configuration data contained inside of
26527  DRV_SPI_INIT.
26528  Remarks:
26529  None.
26530 */
26531 
26532 typedef
26533 struct _DRV_SPI_CLIENT_DATA
26534 {
26535  /* Baud Rate Value */
26536  uint32_t baudRate ;
26537  /* This callback is fired when an operation is about to start on the
26538  SPI bus. This allows the user to set any pins that need to be set.
26539  This callback may be called from an ISR so should not include OSAL
26540  calls. The context parameter is the same one passed into the
26541  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26542  */
26544  /* This callback is fired when an operation has just completed on the
26545  SPI bus. This allows the user to set any pins that need to be set.
26546  This callback may be called from an ISR so should not include OSAL
26547  calls. The context parameter is the same one passed into the
26548  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26549  */
26552 //DOM-IGNORE-BEGIN
26553 //DOM-IGNORE-END
26554  // #ifndef _DRV_SPI_DEFINITIONS_H
26555 /*******************************************************************************
26556  End of File
26557 */
26558 
26559 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26560 /* CLOSE_FILE Include File */
26561 
26562 // DOM-IGNORE-BEGIN
26563 // DOM-IGNORE-END
26564 // *****************************************************************************
26565 // *****************************************************************************
26566 // Section: Interface Routines - System Level
26567 // *****************************************************************************
26568 // *****************************************************************************
26569 // *****************************************************************************
26570 /* Function:
26571  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26572  const SYS_MODULE_INIT * const init )
26573  Summary:
26574  Initializes the SPI instance for the specified driver index.
26575  <p><b>Implementation:</b> Static/Dynamic</p>
26576  Description:
26577  This routine initializes the SPI driver instance for the specified driver
26578  index, making it ready for clients to open and use it. The initialization
26579  data is specified by the 'init' parameter. The initialization may fail if the
26580  number of driver objects allocated are insufficient or if the specified
26581  driver instance is already initialized. The driver instance index is
26582  independent of the SPI module ID. For example, driver instance 0 can be
26583  assigned to SPI2. If the driver is built statically, then some of the
26584  initialization parameters are overridden by configuration macros. Refer to
26585  the description of the DRV_SPI_INIT data structure for more details on
26586  which members on this data structure are overridden.
26587  Precondition:
26588  None.
26589  Parameters:
26590  index - Identifier for the instance to be initialized. Please note this
26591  is not the SPI id. The hardware SPI id is set in the initialization
26592  structure. This is the index of the driver index to use.
26593  init - Pointer to a data structure containing any data necessary to
26594  initialize the driver. If this pointer is NULL, the driver
26595  uses the static initialization override macros for each
26596  member of the initialization data structure.
26597  Returns:
26598  - If successful - returns a valid handle to a driver instance object
26599  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26600  Example:
26601  <code>
26602  DRV_SPI_INIT init;
26603  SYS_MODULE_OBJ objectHandle;
26604  // Populate the SPI initialization structure
26605  init.spiId = SPI_ID_1,
26606  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26607  init.spiMode = DRV_SPI_MODE_MASTER,
26608  init.allowIdleRun = false,
26609  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26610  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26611  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26612  init.spiClk = CLK_BUS_PERIPHERAL_2,
26613  init.baudRate = 10000000,
26614  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26615  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26616  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26617  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26618  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26619  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26620  init.dummyByteValue = 0xFF,
26621  init.queueSize = 10,
26622  init.jobQueueReserveSize = 1,
26623  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26624  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26625  {
26626  // Handle error
26627  }
26628  </code>
26629  Remarks:
26630  This routine must be called before any other SPI routine is called.
26631  This routine should only be called once during system initialization
26632  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26633  instance. This routine will NEVER block for hardware access.
26634 */
26635 
26636 SYS_MODULE_OBJ
26638  const SYS_MODULE_INDEX index ,
26639  const SYS_MODULE_INIT * const init ) ;
26640 //*************************************************************************
26641 /* Function:
26642  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26643  Summary:
26644  Deinitializes the specified instance of the SPI driver module.
26645  <p><b>Implementation:</b> Static/Dynamic</p>
26646  Description:
26647  Deinitializes the specified instance of the SPI driver module,
26648  disabling its operation (and any hardware) and invalidates all of the
26649  internal data.
26650  Precondition:
26651  Function DRV_SPI_Initialize must have been called before calling this
26652  routine and a valid SYS_MODULE_OBJ must have been returned.
26653  Parameters:
26654  object - Driver object handle, returned from DRV_SPI_Initialize
26655  Returns:
26656  None.
26657  Example:
26658  <code>
26659  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26660  SYS_STATUS status;
26661  DRV_SPI_Deinitialize ( object );
26662  status = DRV_SPI_Status( object );
26663  if( SYS_MODULE_UNINITIALIZED == status )
26664  {
26665  // Check again later if you need to know
26666  // when the driver is deinitialized.
26667  }
26668  </code>
26669  Remarks:
26670  Once the Initialize operation has been called, the De-initialize
26671  operation must be called before the Initialize operation can be called
26672  again.
26673  This function will NEVER block waiting for hardware. If the operation
26674  requires time to allow the hardware to complete, this will be reported
26675  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26676  to find out when the module is in the ready state.
26677 */
26678 
26679 void
26681  SYS_MODULE_OBJ object ) ;
26682 //**************************************************************************
26683 /* Function:
26684  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26685  Summary:
26686  Provides the current status of the SPI driver module.
26687  <p><b>Implementation:</b> Static/Dynamic</p>
26688  Description:
26689  This function provides the current status of the SPI driver module.
26690  Precondition:
26691  The DRV_SPI_Initialize function must have been called before calling
26692  this function.
26693  Parameters:
26694  object - Driver object handle, returned from DRV_SPI_Initialize
26695  Returns:
26696  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26697  system level operation and cannot start another
26698  Example:
26699  <code>
26700  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26701  SYS_STATUS status;
26702  status = DRV_SPI_Status( object );
26703  if( SYS_STATUS_READY != status )
26704  {
26705  // Handle error
26706  }
26707  </code>
26708  Remarks:
26709  Any value greater than SYS_STATUS_READY is also a normal running state
26710  in which the driver is ready to accept new operations.
26711  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26712  deinitialized
26713  This value is less than SYS_STATUS_ERROR.
26714  This function can be used to determine when any of the driver's module
26715  level operations has completed.
26716  If the status operation returns SYS_STATUS_BUSY, the previous operation
26717  has not yet completed. Once the status operation returns
26718  SYS_STATUS_READY, any previous operations have completed.
26719  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26720  that is also an error state.
26721  This function will NEVER block waiting for hardware.
26722  If the Status operation returns an error value, the error may be
26723  cleared by calling the reinitialize operation. If that fails, the
26724  deinitialize operation will need to be called, followed by the
26725  initialize operation to return to normal operations.
26726 */
26727 
26728 SYS_STATUS
26729  DRV_SPI_Status (
26730  SYS_MODULE_OBJ object ) ;
26731 // *****************************************************************************
26732 /* Function:
26733  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26734  Summary:
26735  Maintains the driver's state machine and implements its ISR.
26736  <p><b>Implementation:</b> Static/Dynamic</p>
26737  Description:
26738  This routine is used to maintain the driver's internal state
26739  machine and implement its transmit ISR for interrupt-driven implementations.
26740  In polling mode, this function should be called from the SYS_Tasks()
26741  function. In interrupt mode, this function should be called in the transmit
26742  interrupt service routine of the USART that is associated with this USART
26743  driver hardware instance.
26744  Precondition:
26745  The DRV_SPI_Initialize routine must have been called for the specified
26746  SPI driver instance.
26747  Parameters:
26748  object - Object handle for the specified driver instance (returned from
26749  DRV_SPI_Initialize)
26750  Returns:
26751  None.
26752  Example:
26753  <code>
26754  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26755  while( true )
26756  {
26757  DRV_SPI_Tasks ( object );
26758  // Do other tasks
26759  }
26760  </code>
26761  Remarks:
26762  This function is normally not called directly by an application. It is
26763  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26764  ISR.
26765  This function may execute in an ISR context and will never block or access any
26766  resources that may cause it to block.
26767 */
26768 
26769 void
26770  DRV_SPI_Tasks (
26771  SYS_MODULE_OBJ object ) ;
26772 // *****************************************************************************
26773 // *****************************************************************************
26774 // Section: Interface Routines - Client Level
26775 // *****************************************************************************
26776 // *****************************************************************************
26777 //**************************************************************************
26778 /* Function:
26779  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26780  const DRV_IO_INTENT ioIntent )
26781  Summary:
26782  Opens the specified SPI driver instance and returns a handle to it.
26783  <p><b>Implementation:</b> Static/Dynamic</p>
26784  Description:
26785  This routine opens the specified SPI driver instance and provides a
26786  handle that must be provided to all other client-level operations to
26787  identify the caller and the instance of the driver. The ioIntent
26788  parameter defines how the client interacts with this driver instance.
26789  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26790  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26791  able to write to the driver. If the ioIntent in
26792  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26793  write.
26794  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26795  exclusive access to this client. The driver cannot be opened by any
26796  other client.
26797  Precondition:
26798  The DRV_SPI_Initialize function must have been called before calling
26799  this function.
26800  Parameters:
26801  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26802  Please note this is not the SPI ID.
26803  ioIntent - Zero or more of the values from the enumeration
26804  DRV_IO_INTENT ORed together to indicate the intended use of
26805  the driver
26806  Returns:
26807  If successful, the routine returns a valid open-instance handle (a
26808  number identifying both the caller and the module instance).
26809  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26810  can occur when the following is true:
26811  * if the number of client objects allocated via
26812  DRV_SPI_INSTANCES_NUMBER is insufficient
26813  * if the client is trying to open the driver but driver has been
26814  opened exclusively by another client
26815  * if the driver hardware instance being opened is not initialized or
26816  is invalid
26817  Example:
26818  <code>
26819  DRV_HANDLE handle;
26820  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26821  if( DRV_HANDLE_INVALID == handle )
26822  {
26823  // Unable to open the driver
26824  }
26825  </code>
26826  Remarks:
26827  The handle returned is valid until the DRV_SPI_Close routine is
26828  called. This routine will NEVER block waiting for hardware. If the
26829  requested intent flags are not supported, the routine will return
26830  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26831  It should not be called in an ISR.
26832 */
26833 
26834 DRV_HANDLE
26835  DRV_SPI_Open (
26836  const SYS_MODULE_INDEX drvIndex ,
26837  const DRV_IO_INTENT ioIntent ) ;
26838 //**************************************************************************
26839 /* Function:
26840  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26841  const DRV_SPI_CLIENT_DATA * cfgData )
26842  Summary:
26843  Configures a SPI client with specific data.
26844  <p><b>Implementation:</b> Static/Dynamic</p>
26845  Description:
26846  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26847  Whenever a new SPI job is started these values will be used. Passing in NULL will
26848  reset the client back to configuration parameters passed to driver initialization.
26849  A zero in any of the structure elements will reset that specific configuration back
26850  to the driver default.
26851  Precondition:
26852  The DRV_SPI_Open function must have been called before calling
26853  this function.
26854  Parameters:
26855  handle - handle of the client returned by DRV_SPI_Open.
26856  cfgData - Client-specific configuration data.
26857  Returns:
26858  - If successful - the routing will return greater than or equal to zero
26859  - If an error occurs - the return value is negative
26860 */
26861 
26862 int32_t
26864  DRV_HANDLE handle ,
26865  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26866 // *****************************************************************************
26867 /* Function:
26868  void DRV_SPI_Close ( DRV_HANDLE handle )
26869  Summary:
26870  Closes an opened instance of the SPI driver.
26871  <p><b>Implementation:</b> Static/Dynamic</p>
26872  Description:
26873  This function closes an opened instance of the SPI driver, invalidating the
26874  handle.
26875  Precondition:
26876  The DRV_SPI_Initialize routine must have been called for the specified
26877  SPI driver instance.
26878  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26879  Parameters:
26880  handle - A valid open-instance handle, returned from the driver's
26881  open routine
26882  Returns:
26883  None.
26884  Example:
26885  <code>
26886  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26887  DRV_SPI_Close ( handle );
26888  </code>
26889  Remarks:
26890  After calling this routine, the handle passed in "handle" must not be used
26891  with any of the remaining driver routines. A new handle must be obtained by
26892  calling DRV_SPI_Open before the caller may use the driver again. This
26893  function is thread safe in a RTOS application.
26894  Note:
26895  Usually there is no need for the driver client to verify that the Close
26896  operation has completed.
26897 */
26898 
26899 void
26900  DRV_SPI_Close (
26901  DRV_HANDLE handle ) ;
26902 // *****************************************************************************
26903 // *****************************************************************************
26904 // Section: Interface Routines - Client level Read & Write APIs
26905 // *****************************************************************************
26906 // *****************************************************************************
26907 /* These are non-blocking APIs. It doesn't wait until the operation gets
26908  finished. The actual operation will happen it the task routine. The status of
26909  this operation can be monitored using DRV_SPI_BufferStatus function. In
26910  polling mode, User must ensure that the code gets time to execute the task
26911  routine. */
26912 //*******************************************************************************
26913 /* Function:
26914  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26915  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26916  void * context )
26917  Summary:
26918  Registers a buffer for a read operation. Actual transfer will happen in
26919  the Task function.
26920  <p><b>Implementation:</b> Static/Dynamic</p>
26921  Description:
26922  Registers a buffer for a read operation. Actual transfer will happen in
26923  the Task function. The status of this operation can be monitored using
26924  DRV_SPI_BufferStatus function. A optional callback can also be
26925  provided that will be called when the operation is complete.
26926  Precondition:
26927  The DRV_SPI_Initialize routine must have been called for the specified
26928  SPI driver instance.
26929  DRV_SPI_Open must have been called to obtain a valid opened device
26930  handle.
26931  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26932  in the DRV_SPI_Open call.
26933  Parameters:
26934  handle - A valid open-instance handle, returned from the driver's
26935  open routine
26936  rxBuffer - The buffer to which the data should be written to.
26937  size - Number of bytes to be read from the SPI bus.
26938  completeCB - Pointer to a function to be called when this queued operation is complete.
26939  context - unused by the driver but this is passed to the callback when it is called.
26940  Returns:
26941  If the buffer add request is successful, a valid buffer handle is returned.
26942  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26943  Example:
26944  <code>
26945  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26946  char myBuffer[MY_BUFFER_SIZE], state = 0;
26947  DRV_SPI_BUFFER_HANDLE bufferHandle;
26948  switch ( state )
26949  {
26950  case 0:
26951  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26952  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26953  {
26954  state++;
26955  }
26956  break;
26957  case 1:
26958  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26959  {
26960  state++;
26961  // All transmitter data has been sent successfully.
26962  }
26963  break;
26964  }
26965  </code>
26966  Remarks:
26967  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26968  instead of it.
26969  */
26970 
26973  DRV_HANDLE handle ,
26974  void * rxBuffer ,
26975  size_t size ,
26976  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26977  void * context ) ;
26978 //*******************************************************************************
26979 /* Function:
26980  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26981  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26982  void * context )
26983  Summary:
26984  Registers a buffer for a write operation. Actual transfer will happen
26985  in the Task function.
26986  <p><b>Implementation:</b> Static/Dynamic</p>
26987  Description:
26988  Registers a buffer for a write operation. Actual transfer will happen
26989  in the Task function. The status of this operation can be monitored
26990  using DRV_SPI_BufferStatus function. A optional callback can also be
26991  provided that will be called when the operation is complete.
26992  Precondition:
26993  The DRV_SPI_Initialize routine must have been called for the specified
26994  SPI driver instance.
26995  DRV_SPI_Open must have been called to obtain a valid opened device
26996  handle.
26997  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
26998  in the DRV_SPI_Open call.
26999  Parameters:
27000  handle - A valid open-instance handle, returned from the driver's
27001  open routine
27002  txBuffer - The buffer which hold the data.
27003  size - Number of bytes to be written to the SPI bus.
27004  completeCB - Pointer to a function to be called when this queued operation is complete
27005  context - unused by the driver but this is passed to the callback when it is called
27006  Returns:
27007  If the buffer add request is successful, a valid buffer handle is returned.
27008  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27009  Example:
27010  <code>
27011  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27012  char myBuffer[MY_BUFFER_SIZE], state = 0;
27013  DRV_SPI_BUFFER_HANDLE bufferHandle;
27014  switch ( state )
27015  {
27016  case 0:
27017  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27018  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27019  {
27020  state++;
27021  }
27022  break;
27023  case 1:
27024  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27025  {
27026  state++;
27027  // All transmitter data has been sent successfully.
27028  }
27029  break;
27030  }
27031  </code>
27032  Remarks:
27033  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27034  instead of it.
27035 */
27036 
27039  DRV_HANDLE handle ,
27040  void * txBuffer ,
27041  size_t size ,
27042  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27043  void * context ) ;
27044 //*******************************************************************************
27045 /* Function:
27046  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27047  void *txBuffer, void *rxBuffer, size_t size, )
27048  Summary:
27049  Registers a buffer for a read and write operation. Actual transfer will
27050  happen in the Task function.
27051  <p><b>Implementation:</b> Static/Dynamic</p>
27052  Description:
27053  Registers a buffer for a read and write operation. Actual transfer will
27054  happen in the Task function. The status of this operation can be
27055  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27056  provided that will be called when the operation is complete.
27057  Precondition:
27058  The DRV_SPI_Initialize routine must have been called for the specified
27059  SPI driver instance.
27060  DRV_SPI_Open must have been called to obtain a valid opened device
27061  handle.
27062  Parameters:
27063  handle - A valid open-instance handle, returned from the driver's
27064  open routine
27065  txBuffer - The buffer which hold the data.
27066  txSize - Number of bytes to be written to the SPI bus.
27067  rxBuffer - The buffer to which the data should be written to.
27068  rxSize - Number of bytes to be read from the SPI bus
27069  completeCB - Pointer to a function to be called when this queued operation is complete
27070  context - unused by the driver but this is passed to the callback when it is called
27071  Returns:
27072  If the buffer add request is successful, a valid buffer handle is returned.
27073  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27074  Example:
27075  <code>
27076  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27077  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27078  DRV_SPI_BUFFER_HANDLE bufferHandle;
27079  switch ( state )
27080  {
27081  case 0:
27082  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27083  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27084  {
27085  state++;
27086  }
27087  break;
27088  case 1:
27089  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27090  {
27091  state++;
27092  // All transmitter data has been sent successfully.
27093  }
27094  break;
27095  }
27096  </code>
27097  Remarks:
27098  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27099  instead of it.
27100 */
27101 
27104  DRV_HANDLE handle ,
27105  void * txBuffer ,
27106  size_t txSize ,
27107  void * rxBuffer ,
27108  size_t rxSize ,
27109  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27110  void * context ) ;
27111 //*******************************************************************************
27112 /* Function:
27113  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27114  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27115  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27116  Summary:
27117  Registers a buffer for a read operation. Actual transfer will happen in
27118  the Task function.
27119  <p><b>Implementation:</b> Static/Dynamic</p>
27120  Description:
27121  Registers a buffer for a read operation. Actual transfer will happen in
27122  the Task function. The status of this operation can be monitored using
27123  DRV_SPI_BufferStatus function. A optional callback can also be
27124  provided that will be called when the operation is complete.
27125  Precondition:
27126  The DRV_SPI_Initialize routine must have been called for the specified
27127  SPI driver instance.
27128  DRV_SPI_Open must have been called to obtain a valid opened device
27129  handle.
27130  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27131  in the DRV_SPI_Open call.
27132  Parameters:
27133  handle - A valid open-instance handle, returned from the driver's
27134  open routine
27135  rxBuffer - The buffer to which the data should be written to.
27136  size - Number of bytes to be read from the SPI bus.
27137  completeCB - Pointer to a function to be called when this queued operation is complete
27138  context - unused by the driver but this is passed to the callback when it is called
27139  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27140  Returns:
27141  If the buffer add request is successful, a valid buffer handle is returned.
27142  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27143  Example:
27144  <code>
27145  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27146  char myBuffer[MY_BUFFER_SIZE], state = 0;
27147  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27148  switch ( state )
27149  {
27150  case 0:
27151  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27152  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27153  {
27154  state++;
27155  }
27156  break;
27157  case 1:
27158  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27159  {
27160  state++;
27161  // All transmitter data has been sent successfully.
27162  }
27163  break;
27164  }
27165  </code>
27166  Remarks:
27167  None.
27168  */
27169 
27172  DRV_HANDLE handle ,
27173  void * rxBuffer ,
27174  size_t size ,
27175  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27176  void * context ,
27177  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27178 //*******************************************************************************
27179 /* Function:
27180  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27181  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27182  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27183  Summary:
27184  Registers a buffer for a write operation. Actual transfer will happen
27185  in the Task function.
27186  <p><b>Implementation:</b> Static/Dynamic</p>
27187  Description:
27188  Registers a buffer for a write operation. Actual transfer will happen
27189  in the Task function. The status of this operation can be monitored
27190  using DRV_SPI_BufferStatus function. A optional callback can also be
27191  provided that will be called when the operation is complete.
27192  Precondition:
27193  The DRV_SPI_Initialize routine must have been called for the specified
27194  SPI driver instance.
27195  DRV_SPI_Open must have been called to obtain a valid opened device
27196  handle.
27197  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27198  in the DRV_SPI_Open call.
27199  Parameters:
27200  handle - A valid open-instance handle, returned from the driver's
27201  open routine
27202  txBuffer - The buffer which hold the data.
27203  size - Number of bytes to be written to the SPI bus.
27204  completeCB - Pointer to a function to be called when this queued operation is complete
27205  context - unused by the driver but this is passed to the callback when it is called
27206  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27207  Returns:
27208  If the buffer add request is successful, a valid buffer handle is returned.
27209  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27210  Example:
27211  <code>
27212  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27213  char myBuffer[MY_BUFFER_SIZE], state = 0;
27214  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27215  switch ( state )
27216  {
27217  case 0:
27218  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27219  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27220  {
27221  state++;
27222  }
27223  break;
27224  case 1:
27225  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27226  {
27227  state++;
27228  // All transmitter data has been sent successfully.
27229  }
27230  break;
27231  }
27232  </code>
27233  Remarks:
27234  None.
27235 */
27236 
27239  DRV_HANDLE handle ,
27240  void * txBuffer ,
27241  size_t size ,
27242  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27243  void * context ,
27244  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27245 //*******************************************************************************
27246 /* Function:
27247  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27248  void *txBuffer, void *rxBuffer, size_t size,
27249  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27250  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27251  Summary:
27252  Registers a buffer for a read and write operation. Actual transfer will
27253  happen in the Task function.
27254  <p><b>Implementation:</b> Static/Dynamic</p>
27255  Description:
27256  Registers a buffer for a read and write operation. Actual transfer will
27257  happen in the Task function. The status of this operation can be
27258  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27259  provided that will be called when the operation is complete.
27260  Precondition:
27261  The DRV_SPI_Initialize routine must have been called for the specified
27262  SPI driver instance.
27263  DRV_SPI_Open must have been called to obtain a valid opened device
27264  handle.
27265  Parameters:
27266  handle - A valid open-instance handle, returned from the driver's
27267  open routine
27268  txBuffer - The buffer which hold the data.
27269  txSize - Number of bytes to be written to the SPI bus.
27270  rxBuffer - The buffer to which the data should be written to.
27271  rxSize - Number of bytes to be read from the SPI bus
27272  completeCB - Pointer to a function to be called when this queued operation is complete
27273  context - unused by the driver but this is passed to the callback when it is called
27274  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27275  Returns:
27276  If the buffer add request is successful, a valid buffer handle is returned.
27277  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27278  Example:
27279  <code>
27280  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27281  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27282  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27283  switch ( state )
27284  {
27285  case 0:
27286  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27287  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27288  {
27289  state++;
27290  }
27291  break;
27292  case 1:
27293  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27294  {
27295  state++;
27296  // All transmitter data has been sent successfully.
27297  }
27298  break;
27299  }
27300  </code>
27301  Remarks:
27302  None.
27303 */
27304 
27307  DRV_HANDLE handle ,
27308  void * txBuffer ,
27309  size_t txSize ,
27310  void * rxBuffer ,
27311  size_t rxSize ,
27312  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27313  void * context ,
27314  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27315 // *****************************************************************************
27316 /* Function:
27317  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27318  Summary:
27319  Returns the transmitter and receiver transfer status.
27320  <p><b>Implementation:</b> Static/Dynamic</p>
27321  Description:
27322  This returns the transmitter and receiver transfer status.
27323  Precondition:
27324  The DRV_SPI_Initialize routine must have been called for the specified
27325  SPI driver instance.
27326  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27327  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27328  the buffer handle associated with that transfer.
27329  Parameters:
27330  bufferHandle - A valid buffer handle, returned from the driver's
27331  data transfer routine
27332  Returns:
27333  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27334  transfer.
27335  Example:
27336  <code>
27337  // Buffer handle returned from the data transfer function
27338  DRV_SPI_BUFFER_HANDLE bufferHandle;
27339  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27340  {
27341  // All transmitter data has been sent.
27342  }
27343  </code>
27344  Remarks:
27345  The returned status may contain a value with more than one of the bits
27346  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27347  should perform an AND with the bit of interest and verify if the
27348  result is non-zero (as shown in the example) to verify the desired status
27349  bit.
27350 */
27351 
27354  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27355 // *****************************************************************************
27356 /* Function:
27357  bool DRV_SPIn_ReceiverBufferIsFull(void)
27358  Summary:
27359  Returns the receive buffer status. 'n' represents the instance of the
27360  SPI driver used.
27361  <p><b>Implementation:</b> Static</p>
27362  Description:
27363  This function returns the receive buffer status (full/empty).
27364  Precondition:
27365  None.
27366  Parameters:
27367  None.
27368  Returns:
27369  Receive Buffer Status
27370  - 1 - Full
27371  - 0 - Empty
27372  Example:
27373  <code>
27374  bool rxBufStat;
27375  // Using instance 1 of SPI driver, that is n = 1
27376  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27377  if (rxBufStat)
27378  {
27379  ...
27380  }
27381  </code>
27382  Remarks:
27383  None.
27384 */
27385 
27386 bool
27388 // *****************************************************************************
27389 /* Function:
27390  bool DRV_SPIn_TransmitterBufferIsFull(void)
27391  Summary:
27392  Returns the transmit buffer status. 'n' represents the instance of the
27393  SPI driver used.
27394  <p><b>Implementation:</b> Static</p>
27395  Description:
27396  This function returns the transmit buffer status (full/empty).
27397  Precondition:
27398  None.
27399  Parameters:
27400  None.
27401  Returns:
27402  Transmit Buffer Status
27403  - 1 - Full
27404  - 0 - Empty
27405  Example:
27406  <code>
27407  bool txBufStat;
27408  // Using instance 1 of SPI driver, that is n = 1
27409  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27410  if (txBufStat)
27411  {
27412  ...
27413  }
27414  </code>
27415  Remarks:
27416  None.
27417 */
27418 
27419 bool
27421 //DOM-IGNORE-BEGIN
27422 //DOM-IGNORE-END
27423  // #ifndef _DRV_SPI_H
27424 /*******************************************************************************
27425  End of File
27426 */
27427 
27428 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27429 /* CLOSE_FILE Include File */
27430 
27431 #include "driver/usb/usbhs/drv_usbhs.h"
27432 #include "usb/usb_device.h"
27433 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27434 /**************************************************************************************/
27435 /* LDRA_INSPECTED 110 S
27436 */
27452 /**************************************************************************************/
27453 #ifndef APP_H /* Guard against multiple inclusion.*/
27454 #define APP_H
27455 /**************************************************************************************/
27456 /* ************************************************************************************/
27457 /* Section: Included Files */
27458 /**************************************************************************************/
27459 /**************************************************************************************/
27460 #include <stdint.h>
27461 /**************************************************************************************/
27462 /**************************************************************************************/
27463 /* Section: Data Types */
27464 /**************************************************************************************/
27465 /**************************************************************************************/
27466 /**************************************************************************************/
27467 /* APP_DATA
27468  Summary:
27469  Holds APP_DATA used for the APP tasks.
27470  Description:
27471  Holds APP_DATA used for the APP tasks. The variables
27472  used are stored here.
27473  Remarks:
27474  None
27475  */
27476 
27477 typedef
27478  struct
27479  {
27480  uint8_t RevNumber ;
27481  } APP_DATA ;
27482 
27483 extern APP_DATA
27484  APP ;
27485 /**************************************************************************************/
27486 /**************************************************************************************/
27487 /* Section: Application Initialization and State Machine Functions */
27488 /**************************************************************************************/
27489 /**************************************************************************************/
27490 /*!*************************************************************************************
27491  Function:
27492  void APP_Initialize(void)
27493  Summary:
27494  Autonomous tool application initialization routine.
27495  Description:
27496  This function initializes the application. It places the
27497  application in its initial state and prepares it to run so that its
27498  APP_Tasks function can be called.
27499  Precondition:
27500  All other system initialization routines should be called before calling
27501  this routine (in "SYS_Initialize").
27502  Parameters:
27503  None.
27504  Returns:
27505  None.
27506  Example:
27507  APP_Initialize()
27508  Remarks:
27509  This routine must be called from the main function.
27510 */
27511 
27512 void
27513  APP_Initialize ( void ) ;
27514 /*!*************************************************************************************
27515  Function:
27516  void APP_Tasks(void)
27517  Summary:
27518  Application tasks function
27519  Description:
27520  This function is the main application's tasks function. It contains the various
27521  tasks that are maintained during the operation of the shooting panel.
27522  Precondition:
27523  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27524  should be called before calling this.
27525  Parameters:
27526  None.
27527  Returns:
27528  None.
27529  Example:
27530  APP_Tasks()
27531  Remarks:
27532  This routine must be called from the main() routine.
27533  */
27534 
27535 void
27536  APP_Tasks ( void ) ;
27537  /* APP_H */
27538 /***************************************************************************************
27539  End of File
27540  */
27541 
27542 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27543 /* CLOSE_FILE Include File */
27544 
27545 // DOM-IGNORE-BEGIN
27546 // DOM-IGNORE-END
27547 // *****************************************************************************
27548 // *****************************************************************************
27549 // Section: Type Definitions
27550 // *****************************************************************************
27551 // *****************************************************************************
27552 // *****************************************************************************
27553 /* System Objects
27554  Summary:
27555  Structure holding the system's object handles
27556  Description:
27557  This structure contains the object handles for all objects in the
27558  MPLAB Harmony project's system configuration.
27559  Remarks:
27560  These handles are returned from the "Initialize" functions for each module
27561  and must be passed into the "Tasks" function for each module.
27562 */
27563 
27564 typedef
27565  struct
27566  {
27567  SYS_MODULE_OBJ sysTmr ;
27568  SYS_MODULE_OBJ drvTmr0 ;
27569  SYS_MODULE_OBJ drvTmr1 ;
27570  SYS_MODULE_OBJ drvTmr2 ;
27571  SYS_MODULE_OBJ drvTmr3 ;
27572  SYS_MODULE_OBJ drvTmr4 ;
27573  SYS_MODULE_OBJ drvUsart0 ;
27574  SYS_MODULE_OBJ drvPMP0 ;
27575  /*** SPI Object for Index 0 ***/
27576  SYS_MODULE_OBJ spiObjectIdx0 ;
27577  /*** SPI Object for Index 1 ***/
27578  SYS_MODULE_OBJ spiObjectIdx1 ;
27579  /*** SPI Object for Index 2 ***/
27580  SYS_MODULE_OBJ spiObjectIdx2 ;
27581  SYS_MODULE_OBJ drvUSBObject ;
27582  SYS_MODULE_OBJ usbDevObject0 ;
27583  } SYSTEM_OBJECTS ;
27584 // *****************************************************************************
27585 // *****************************************************************************
27586 // Section: extern declarations
27587 // *****************************************************************************
27588 // *****************************************************************************
27589 
27590 extern SYSTEM_OBJECTS
27591  sysObj ;
27592 //DOM-IGNORE-BEGIN
27593 //DOM-IGNORE-END
27594  /* _SYS_DEFINITIONS_H */
27595 /*******************************************************************************
27596  End of File
27597 */
27598 
27599 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27600 /* CLOSE_FILE Include File */
27601 
27602 /**************************************************************************************/
27603 /**************************************************************************************/
27604 /* Section: Data Types */
27605 /**************************************************************************************/
27606 /**************************************************************************************/
27607 /**************************************************************************************/
27608 /* HVPS_STATES
27609  Summary:
27610  HVPS_STATES enumeration
27611  Description:
27612  This enumeration defines the valid HVPS states. These states
27613  determine the behavior of the HVPS state machine at various times.
27614 */
27615 
27616 typedef
27617  enum
27618  {
27631  } HVPS_STATES ;
27632 /**************************************************************************************/
27633 /* HVPS_DATA
27634  Summary:
27635  Holds HVPS_DATA used for the HVPS tasks.
27636  Description:
27637  Holds HVPS_DATA used for the HVPS tasks. The state machine and variables
27638  used to control HVPS functions are stored here.
27639  Remarks:
27640  None
27641  */
27642 
27643 typedef
27644  struct /* This structure collects the variables and states required for these*/
27645  {
27646  /* functions to operate.*/
27647  HVPS_STATES state ;
27648  DRV_HANDLE drvSPIHandle ;
27649  DRV_SPI_BUFFER_HANDLE bufferHandle ;
27650  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
27651  bool spi_write_complete_flag ;
27652  bool spi_sent_flag ;
27653  uint16_t adj [ 1 ] ;
27654  uint16_t cont_in ;
27655  bool pot_switch ;
27656  bool new_cont_values_flag ;
27657  bool tick ;
27658  uint16_t cont_prev ;
27659  uint16_t cont_new ;
27660  uint16_t count ;
27661  bool pos_dir ;
27662  bool shutdown ;
27663  uint16_t update_rate ;
27664  uint16_t rate_time ;
27665  uint16_t update_count ;
27666  bool update_flag ;
27667  uint16_t voltage ;
27668  uint16_t current ;
27669  uint16_t sensor_offset ;
27670  uint16_t offset ;
27671  uint16_t sensor_constant ;
27672  uint16_t max_current ;
27673  uint16_t current_limit ;
27674  uint16_t upper_current_limit ;
27675  uint8_t over_current_count ;
27676  bool new_current_values_flag ;
27677  bool new_voltage_values_flag ;
27678  bool overcurrent_flag ;
27679  bool overvoltage_flag ;
27680  } HVPS_DATA ;
27681 
27682 extern HVPS_DATA
27683  HV_PS ;
27684 /**************************************************************************************/
27685 /**************************************************************************************/
27686 /* Section: Interface Functions */
27687 /**************************************************************************************/
27688 /**************************************************************************************/
27689 /*!*************************************************************************************
27690  Function:
27691  void Set_HVPS_Ramp_Rate( uint16_t value )
27692  Summary:
27693  This function sets update rate for the HVPS control voltage.
27694  Description:
27695  This function sets update rate for the HVPS control voltage. Value is a rate in
27696  volts/second. This value is then converted to an update rate for the control DAC.
27697  For example, an update value of 100V/second gives an DAC update rate of approx.
27698  20mS. This update rate is used with Timer 1 to control when the control DAC is
27699  updated.
27700 
27701  Precondition:
27702  None.
27703  Parameters:
27704  uint16_t value: Value representing volts/second.
27705  Returns
27706  None.
27707 
27708  Remarks:
27709  None.
27710 
27711  Example:
27712  SET_WL_SPS_IOffset( unsigned char mode )
27713  */
27714 
27715 void
27717  uint16_t value ) ;
27718 /**************************************************************************************/
27719 /**************************************************************************************/
27720 /* State Machine Functions */
27721 /**************************************************************************************/
27722 /**************************************************************************************/
27723 /*!*************************************************************************************
27724  Function:
27725  void HVPS_Tasks(void)
27726  Summary:
27727  HVPS tasks function
27728  Description:
27729  This routine is the HVPS tasks function. It defines the HVPS's state machine and
27730  core logic.
27731  Precondition:
27732  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27733  should be called before calling this.
27734  Parameters:
27735  None.
27736  Returns:
27737  None.
27738  Example:
27739  HVPS_Tasks()
27740 
27741  Remarks:
27742  This routine must be called from APP_Tasks() routine.
27743  */
27744 
27745 void
27746  HVPS_Tasks ( void ) ;
27747  /* HVPS_H */
27748 /***************************************************************************************
27749  End of File
27750  */
27751 
27752 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h*/
27753 /* CLOSE_FILE Include File */
27754 
27755 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h */
27756 /**************************************************************************************/
27770 /**************************************************************************************/
27771 #ifndef ADC_H /* Guard against multiple inclusion.*/
27772 #define ADC_H
27773 /**************************************************************************************/
27774 /**************************************************************************************/
27775 /* Section: Included Files */
27776 /**************************************************************************************/
27777 /**************************************************************************************/
27778 #include <stdint.h>
27779 #include <stdbool.h>
27780 /**************************************************************************************/
27781 /**************************************************************************************/
27782 /* Section: Data Types */
27783 /**************************************************************************************/
27784 /**************************************************************************************/
27785 /**************************************************************************************/
27786 /* ADC states
27787  Summary:
27788  ADC states enumeration
27789  Description:
27790  This enumeration defines the valid ADC states. These states
27791  determine the behavior of the ADC state machine at various times.
27792 */
27793 
27794 typedef
27795  enum
27796  {
27801  } ADC_STATES ;
27802 /**************************************************************************************/
27803 /* ADC_DATA
27804  Summary:
27805  Holds ADC_DATA used for the ADC tasks.
27806  Description:
27807  Holds ADC_DATA used for the ADC tasks. The state machine and variables
27808  used to control ADC functions are stored here.
27809  Remarks:
27810  None
27811  */
27812 
27813 typedef
27814  struct /* This structure collects the variables and states required for these*/
27815  {
27816  /* functions to operate.*/
27817  ADC_STATES state ;
27818  uint16_t hvps_i ;
27819  uint16_t hvps_cont ;
27820  uint16_t wl_cps_i ;
27821  uint16_t wl_cps_v ;
27822  uint16_t wl_sps_i_cf ;
27823  uint16_t wl_sps_i ;
27824  bool tick ;
27825  bool ADCInt ;
27826  } ADC_DATA ;
27827 
27828 extern ADC_DATA
27829  ADC ;
27830 /**************************************************************************************/
27831 /**************************************************************************************/
27832 /* State Machine Functions */
27833 /**************************************************************************************/
27834 /**************************************************************************************/
27835 /*!*************************************************************************************
27836  Function:
27837  void ADC_Tasks(void)
27838  Summary:
27839  ADC tasks function
27840  Description:
27841  This routine is the ADC tasks function. It defines the ADC's state machine and
27842  core logic. This machine initializes the Timer and ADCs used to digitize signal
27843  inputs. Once the timer and ADCs are started, this machine is set to idle and the
27844  the updated ADC values are retrieved in the system interrupt routine.
27845  Precondition:
27846  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27847  should be called before calling this.
27848  Parameters:
27849  None.
27850  Returns:
27851  None.
27852  Example:
27853  ADC_Tasks()
27854 
27855  Remarks:
27856  This routine must be called from the APP_Tasks() routine.
27857  */
27858 
27859 void
27860  ADC_Tasks ( void ) ;
27861  /* ADC_H */
27862 /***************************************************************************************
27863  End of File
27864  */
27865 
27866 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h*/
27867 /* CLOSE_FILE Include File */
27868 
27869 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h */
27870 /**************************************************************************************/
27884 /**************************************************************************************/
27885 #ifndef MAN_H /* Guard against multiple inclusion.*/
27886 #define MAN_H
27887 /**************************************************************************************/
27888 /**************************************************************************************/
27889 /* Section: Included Files */
27890 /**************************************************************************************/
27891 /**************************************************************************************/
27892 #include <stdbool.h>
27893 #include "../system_config.h"
27894 #include "../system_definitions.h"
27895 /**************************************************************************************/
27896 /**************************************************************************************/
27897 /* Section: Defines */
27898 /**************************************************************************************/
27899 /**************************************************************************************/
27900 /* Define the upper and lower bounds for Manchester data, TMR4 tick = 200nsec * 8 = 1.6usec */
27901 /* Define the upper and lower bounds for Manchester data, TMR2 tick = 10nS * 16 = 160nS. */
27902 //#define ManHalfUpper 1171 /* 1.8736 mS.*/
27903 //#define ManHalfLower 500 /* 0.8 mS.*/
27904 //#define ManFullUpper 1953 /* 3.12148 mS.*/
27905 //#define ManFullLower 1172 /* 1.8752 mS.*/
27906 //#define ManHalfUpper 6400 /* 1.8736 mS.?*/ /* time div = 32*/
27907 //#define ManHalfLower 1000 /* 0.8 mS.?*/
27908 //#define ManFullUpper 10000 /* 3.12148 mS.?*/
27909 //#define ManFullLower 6401 /* 1.8752 mS.?*/
27910 #define ManHalfUpper 11800U
27911 #define ManHalfLower 2000U
27912 #define ManFullUpper 20000U
27913 #define ManFullLower 11801U
27914 #define NoManBits 32U
27915 #define HalfBit 0x12U
27916 #define FullBit 0x10U
27917 #define SizeOfBiasLUT 48U
27918 /**************************************************************************************/
27919 /**************************************************************************************/
27920 /* Section: Data Types */
27921 /**************************************************************************************/
27922 /**************************************************************************************/
27923 
27924 typedef
27925 float
27927 /**************************************************************************************/
27928 /* MAN states
27929  Summary:
27930  MAN states enumeration
27931  Description:
27932  This enumeration defines the valid MAN states. These states determine the
27933  behavior of the MAN state machine at various times. This machine controls when
27934  the MAN_RX and MAN_PROCESS machines execute their states.
27935 */
27936 
27937 typedef
27938  enum
27939  {
27946  } MAN_STATES ;
27947 /**************************************************************************************/
27948 /* MAN_RX_STATES
27949  Summary:
27950  MAN_RX_STATES enumeration
27951  Description:
27952  This enumeration defines the valid MAN_RX_STATES. These states determine the
27953  behavior of the MAN_RX_STATES machine at various times. This machine receives
27954  the data from a PerfSwtich.
27955 */
27956 
27957 typedef
27958  enum
27959  {
27963  } MAN_RX_STATES ;
27964 /**************************************************************************************/
27965 /* MAN_PROCESS_STATES
27966  Summary:
27967  MAN_PROCESS_STATES enumeration
27968  Description:
27969  This enumeration defines the valid MAN_PROCESS_STATES. These states
27970  determine the behavior of the MAN_PROCESS_STATES machine at various times.
27971 */
27972 
27973 typedef
27974  enum
27975  {
27979  } MAN_PROCESS_STATES ;
27980 /**************************************************************************************/
27981 /* MAN_DATA
27982  Summary:
27983  Holds MAN_DATA used for the Manchester tasks.
27984  Description:
27985  Holds MAN_DATA used for the Manchester tasks. The state machines and variables
27986  used to control Manchester functions are stored here.
27987  Remarks:
27988  None
27989  */
27990 
27991 typedef
27992  struct
27993  {
27994  MAN_STATES state ;
27995  MAN_RX_STATES Rx_state ;
27996  MAN_PROCESS_STATES Process_state ;
27997  uint16_t preamble [ 5 ] ;
27998  uint16_t time [ 96 ] ;
27999  uint8_t level [ 96 ] ;
28000  uint8_t ans [ 32U + 2 ] ;
28001  uint8_t msg [ 4 ] ;
28002  uint8_t cnt_preamble ;
28003  uint8_t trynumber ;
28004  bool process_complete_flag ;
28005  bool spi_write_complete_flag ;
28006  bool spi_sent_flag ;
28007  uint8_t timer_count ;
28008  uint8_t timer_complete ;
28009  bool tick ;
28010  bool bad_crc ;
28011  bool error ;
28012  bool manual_bias_flag ;
28013  uint8_t crc ;
28014  } MAN_DATA ;
28015 
28016 extern MAN_DATA
28017  MAN ;
28018 /**************************************************************************************/
28019 /* MAN_BIAS_DATA
28020  Summary:
28021  Holds MAN_BIAS_DATA
28022  Description:
28023  This structure holds the MAN_BIAS_DATA. It is used to adjust the bias value of
28024  the Manchester DAC.
28025  Remarks:
28026  None
28027  */
28028 
28029 typedef
28030  struct
28031  {
28032  DRV_HANDLE spi_bias_fsk ;
28033  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28034  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28035  uint16_t adj [ 1 ] ;
28036  uint16_t dac_a_setting ;
28037  uint16_t dac_b_setting ;
28038  float32_t hi_current ;
28039  float32_t lo_current ;
28040  float32_t lo_volts ;
28041  float32_t hi_volts ;
28042  float32_t slope ;
28043  float32_t offset ;
28044  uint8_t index ;
28045  } MAN_BIAS_DATA ;
28046 
28047 extern MAN_BIAS_DATA
28048  MAN_BIAS ;
28049 /**************************************************************************************/
28050 /**************************************************************************************/
28051 /* Local Functions */
28052 /**************************************************************************************/
28053 /**************************************************************************************/
28054 /*!*************************************************************************************
28055  Function:
28056  static void Init_Manchester( void )
28057  Summary:
28058  Function to initialize the Manchester parameters.
28059  Description:
28060  Function to initialize the Manchester parameters.
28061 
28062  Precondition:
28063  None.
28064  Parameters:
28065  None.
28066  Returns:
28067  None.
28068 
28069  Remarks:
28070  None.
28071 
28072  Example:
28073  Init_Manchester()
28074  */
28075 
28076 static void
28077  Init_Manchester ( void ) ;
28078 /*!*************************************************************************************
28079  Function:
28080  static bool Check_Manchester( void )
28081  Summary:
28082  This routine checks for valid Manchester response.
28083  Description:
28084  This routine checks for valid Manchester response. The first two bytes are
28085  checked. If both are zero, then we did not receive a valid response. This is
28086  used in the function Test_Manchester.
28087 
28088  Precondition:
28089  None.
28090  Parameters:
28091  None.
28092  Returns:
28093  bool ans
28094 
28095  Remarks:
28096  None.
28097 
28098  Example:
28099  if( Check_Manchester( ) == true )
28100  */
28101 
28102 static bool
28103  Check_Manchester ( void ) ;
28104 /*!*************************************************************************************
28105  Function:
28106  static void Decode_Manchester( void )
28107  Summary:
28108  Function to decode the Manchester response from a PerfSwitch.
28109  Description:
28110  Function to decode the Manchester response from a PerfSwitch. The MAN.level
28111  and MAN.time arrays are used to generate the MAN.ANS array.
28112  MAN.level[] - level of the incoming data.
28113  MAN.time[] - time of corresponding wave timer ticks.
28114 
28115  The last 1 of the preamble is always in the data so we have a fixed starting point.
28116 
28117  Precondition:
28118  None.
28119  Parameters:
28120  None.
28121  Returns:
28122  None.
28123 
28124  Remarks:
28125  None.
28126 
28127  Example:
28128  Decode_Manchester()
28129  */
28130 
28131 static void
28132  Decode_Manchester ( void ) ;
28133 /*!*************************************************************************************
28134  Function:
28135  static void Package_Manchester( void )
28136  Summary:
28137  Function to prepare Manchester response for further processing.
28138  Description:
28139  Function to prepare Manchester response for further processing. The Manchester
28140  response is decoded and the 1 X 32 answer array is packed into a 4 X 8 bit
28141  message array.
28142 
28143  Precondition:
28144  None.
28145  Parameters:
28146  None.
28147  Returns:
28148  None.
28149 
28150  Remarks:
28151  None.
28152 
28153  Example:
28154  Package_Manchester()
28155  */
28156 
28157 static void
28158  Package_Manchester ( void ) ;
28159 /*!*************************************************************************************
28160  Function:
28161  static void Test_Manchester (void)
28162  Summary:
28163  Function to test the returned Manchester message.
28164  Description:
28165  Function to test the returned Manchester message. The first two bytes are checked
28166  to make sure they are not both 0. If they are not, the FSK frequencies are
28167  adjusted, and the CRC is checked. If the CRC is a match, then a response message
28168  to the host is prepared. Otherwise, up to two different FSK frequencies are
28169  tried in order to establish communications with a PerfSwitch.
28170 
28171  Precondition:
28172  None.
28173  Parameters:
28174  None.
28175  Returns:
28176  None.
28177 
28178  Remarks:
28179  None.
28180 
28181  Example:
28182  Test_Manchester ()
28183  */
28184 
28185 static void
28186  Test_Manchester ( void ) ;
28187 /*!*************************************************************************************
28188  Function:
28189  static void Flush_Buffer_Manchester( void )
28190  Summary:
28191  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
28192  Description:
28193  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
28194  These are flushed after every reception.
28195 
28196  Precondition:
28197  None.
28198  Parameters:
28199  None.
28200  Returns:
28201  None.
28202 
28203  Remarks:
28204  None.
28205 
28206  Example:
28207  Flush_Buffer_Manchester()
28208  */
28209 
28210 static void
28211  Flush_Buffer_Manchester ( void ) ;
28212 /*!*************************************************************************************
28213  Function:
28214  static float32_t Calc_Fsk_Scaling( void )
28215  Summary:
28216  Function to calculate the amount of FSK adjustment needed based on the preamble bit
28217  timer counts.
28218  Description:
28219  Function to calculate the amount of FSK adjustment needed based on the preamble bit
28220  timer counts. The average of the timer counts is used to determine the amount
28221  of adjustment. The result is a multiplier used in the Generate_Sine_Wave _Data
28222  function to change the amount of time between the FSK DAC updates. Adjustments
28223  up to 10% have been seen in temperature testing. Adjustments are generally
28224  greater than 1 when a PerfSwitch is hot and less than 1 when a PerfSwitch is cold.
28225 
28226  Precondition:
28227  None.
28228  Parameters:
28229  None.
28230  Returns:
28231  None.
28232 
28233  Remarks:
28234  None.
28235 
28236  Example:
28237  CalcFskScaling( )
28238  */
28239 
28240 static float32_t
28241  Calc_Fsk_Scaling ( void ) ;
28242 /**************************************************************************************/
28243 /**************************************************************************************/
28244 /* Interface Functions */
28245 /**************************************************************************************/
28246 /**************************************************************************************/
28247 /*!*************************************************************************************
28248  Function:
28249  void Calc_Auto_Bias(void)
28250  Summary:
28251  Function to calculate the amount of bias adjust required and to transmit that
28252  result via a SPI port to the Manchester bias DAC.
28253  Description:
28254  Function to calculate the amount of bias adjust required and to transmit that
28255  result via a SPI port to the Manchester bias DAC.
28256 
28257  Precondition:
28258  None.
28259  Parameters:
28260  None.
28261  Returns:
28262  None.
28263 
28264  Remarks:
28265  None.
28266 
28267  Example:
28268  CalcAutoBias()
28269  */
28270 
28271 void
28272  Calc_Auto_Bias ( void ) ;
28273 /*!*************************************************************************************
28274  Function:
28275  void Set_Bias(uint8_t value)
28276  Summary:
28277  Function to transmit the bias adjust value via an SPI port to the Manchester
28278  bias DAC.
28279  Description:
28280  Function to transmit the bias adjust value via an SPI port to the Manchester
28281  bias DAC. Value is integer between 0 and 47. Values greater than 47 are set to 47.
28282 
28283  Precondition:
28284  None.
28285  Parameters:
28286  uint8_t value
28287  Returns:
28288  None.
28289 
28290  Remarks:
28291  None.
28292 
28293  Example:
28294  Set_Bias(uint8_t value)
28295  */
28296 
28297 void
28298  Set_Bias (
28299  uint8_t value ) ;
28300 /**************************************************************************************/
28301 /**************************************************************************************/
28302 /* State Machine Functions */
28303 /**************************************************************************************/
28304 /**************************************************************************************/
28305 /*!*************************************************************************************
28306  Function:
28307  void MAN_Tasks(void)
28308  Summary:
28309  MAN tasks function
28310  Description:
28311  This routine is the MAN tasks function. It defines the MAN's state machine and
28312  core logic. This machine controls the MAN operation and sets flags indicating
28313  new values are available from the system interrupt routine for use in other parts
28314  of the application. It also controls when the MAN_Process_Tasks machine and
28315  MAN_RX_Tasks machines operate.
28316  Precondition:
28317  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28318  should be called before calling this.
28319  Parameters:
28320  None.
28321  Returns:
28322  None.
28323  Example:
28324  MAN_Tasks()
28325 
28326  Remarks:
28327  This routine must be called from the APP_Tasks() routine.
28328  */
28329 
28330 void
28331  MAN_Tasks ( void ) ;
28332 /*!*************************************************************************************
28333  Function:
28334  static void MAN_PROCESS_Tasks(void)
28335  Summary:
28336  MAN_PROCESS tasks function
28337  Description:
28338  This routine is the MAN_PROCESS tasks function. It defines the MAN_PROCESS's
28339  state machine and core logic. This machine controls the MAN_Process operation. It
28340  decodes, packages, tests and prepares for another message to process.
28341 
28342  During packaging, the 32 bit Manchester response is packaged into a 4 byte array.
28343 
28344  During testing, the CRC is checked and the appropriate response is prepared to
28345  send to the host. If a bad response was received, the FSK frequencies are adjusted
28346  and two more attempts are made to retrieve a valid response.
28347 
28348  Precondition:
28349  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28350  should be called before calling this.
28351  Parameters:
28352  None.
28353  Returns:
28354  None.
28355  Example:
28356  MAN_PROCESS_Tasks()
28357 
28358  Remarks:
28359  This routine must be called from the MAN_Tasks() routine.
28360  */
28361 
28362 static void
28363  MAN_PROCESS_Tasks ( void ) ;
28364 /*!*************************************************************************************
28365  Function:
28366  void MAN_RX_Tasks(void)
28367  Summary:
28368  MAN_Rx tasks function
28369  Description:
28370  This routine is the MAN_Rx tasks function. It defines the MAN_Rx's
28371  state machine and core logic. It determines if a proper message preamble has
28372  been received and determines the time and input level state when a transition
28373  occurs. This routine is called when there is a high to low change on the port pin.
28374 
28375  The state MAN_RX_STATE_IDLE has no effect on Manchester processing.
28376  The state MAN_RX_STATE_PREAMBLE is responsible for syncing up to a 1111.
28377  The state MAN_RX_STATE_DATA receives the data. The time ranges allow for variances
28378  between PerfSwitches and how they perform over temperature.
28379 
28380  Precondition:
28381  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28382  should be called before calling this.
28383  Parameters:
28384  None.
28385  Returns:
28386  None.
28387  Example:
28388  MAN_RX_Tasks()
28389 
28390  Remarks:
28391  This routine must be called from the MAN_Tasks() routine.
28392  */
28393 
28394 void
28395  MAN_RX_Tasks ( void ) ;
28396  /* MAN_H */
28397 /***************************************************************************************
28398  End of File
28399  */
28400 
28401 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h*/
28402 /* CLOSE_FILE Include File */
28403 
28404 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h */
28405 /**************************************************************************************/
28421 /**************************************************************************************/
28422 #ifndef WL_SPS_H /* Guard against multiple inclusion */
28423 #define WL_SPS_H
28424 /**************************************************************************************/
28425 /**************************************************************************************/
28426 /* Section: Included Files */
28427 /**************************************************************************************/
28428 /**************************************************************************************/
28429 #include "../system_config.h"
28430 #include "../system_definitions.h"
28431 #include <stdbool.h>
28432 /**************************************************************************************/
28433 /**************************************************************************************/
28434 /* Section: Defines */
28435 /**************************************************************************************/
28436 /**************************************************************************************/
28437  /* A brief description of a section can be given directly below the section
28438  banner.
28439  */
28440 #define NEGATIVE_OFFSET 0x02U
28441 #define POS_HIGH_OFFSET 0x01U
28442 #define POS_LOW_OFFSET 0x03U
28443 #define DEFAULT_OFFSET 0x04U
28444 #define I_ARRAY_SIZE 50U
28445 
28446 typedef
28447 float
28448  float32_t ;
28449 /**************************************************************************************/
28450 /**************************************************************************************/
28451 /* Section: Data Types */
28452 /**************************************************************************************/
28453 /**************************************************************************************/
28454 /**************************************************************************************/
28455 /* WL_SPS_STATES
28456  Summary:
28457  WL_SPS_STATES enumeration
28458  Description:
28459  This enumeration defines the valid WL_SPS states. These states
28460  determine the behavior of the WL_SPS state machine at various times.
28461 */
28462 
28463 typedef
28464  enum
28465  {
28473  } WL_SPS_STATES ;
28474 /**************************************************************************************/
28475 /* WL_SPS_DATA
28476  Summary:
28477  Holds WL_SPS_DATA used for the WL_SPS tasks.
28478  Description:
28479  Holds WL_SPS_DATA used for the WL_SPS tasks. The state machine and variables
28480  used to control WL_SPS functions are stored here.
28481  Remarks:
28482  None
28483  */
28484 
28485 typedef
28486  struct
28487  {
28488  WL_SPS_STATES state ;
28489  DRV_HANDLE drvICHandle ;
28490  uint16_t voltage ;
28491  uint16_t voltage_limit ;
28492  uint16_t upper_voltage_limit ;
28493  uint16_t volt_count ;
28494  uint16_t current ;
28495  uint16_t max_current ;
28496  uint16_t current_limit ;
28497  uint16_t upper_current_limit ;
28498  uint8_t over_current_count ;
28499  uint8_t array_sum_count ;
28500  uint8_t array_count ;
28501  uint16_t offset ;
28502  int16_t i_array [ 50U ] ;
28503  int16_t i_sum ;
28504  bool new_current_values_flag ;
28505  bool new_voltage_values_flag ;
28506  bool overcurrent_flag ;
28507  bool overvoltage_flag ;
28508  uint16_t sensor_offset ;
28509  uint16_t sensor_constant ;
28510  bool sensor_offset_tick ;
28511  uint16_t v_array [ 50 ] ;
28512  uint16_t v_array_count ;
28513  uint32_t v_sum ;
28514  float32_t v_avg ;
28515  bool tick ;
28516  uint8_t no_count ;
28517  bool array_full ;
28518  uint8_t overvoltage_count ;
28519  } WL_SPS_DATA ;
28520 
28521 extern WL_SPS_DATA
28522  WL_SPS ;
28523 /**************************************************************************************/
28524 /**************************************************************************************/
28525 /* Section: Interface Functions */
28526 /**************************************************************************************/
28527 /**************************************************************************************/
28528 /*!*************************************************************************************
28529  Function:
28530  void SET_WL_SPS_IOffset( uint8_t mode )
28531  Summary:
28532  This function sets the wire-line current offset based on external settings.
28533  Description:
28534  This function sets the wire-line current offset based on external settings.
28535 
28536  Precondition:
28537  None.
28538  Parameters:
28539  None.
28540  Returns
28541  None.
28542 
28543  Remarks:
28544  None.
28545 
28546  Example:
28547  SET_WL_SPS_IOffset( uint8_t mode )
28548  */
28549 
28550 void
28552  uint8_t mode ) ;
28553 /*!*************************************************************************************
28554  Function:
28555  void Set_WL_SPS_CurrentLimit(uint16_t value)
28556  Summary:
28557  This function sets the current limit for the wire-line shooting power
28558  supply (WL_SPS).
28559  Description:
28560  This function sets the current limit for the wire-line shooting power
28561  supply (WL_SPS) and ensures it it not greater than the upper current limit.
28562  If the value programmed is greater than the upper current limit, then the the
28563  current limit is set to the upper current limit value.
28564  This is used in the WL_SPS over current check.
28565 
28566  Precondition:
28567  None.
28568  Parameters:
28569  None.
28570  Returns
28571  None.
28572 
28573  Remarks:
28574  None.
28575 
28576  Example:
28577  Set_WL_SPS_CurrentLimit(uint16_t value)
28578  */
28579 
28580 void
28582  uint16_t value ) ;
28583 /**************************************************************************************/
28584 /**************************************************************************************/
28585 /* State Machine Functions */
28586 /**************************************************************************************/
28587 /**************************************************************************************/
28588 /*!*************************************************************************************
28589  Function:
28590  *
28591  void WL_SPS_Tasks(void)
28592  Summary:
28593  WL_SPS_Tasks function
28594  Description:
28595  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28596  machine and core logic. This machine is used to monitor the wire-line shooting
28597  power supply (WL_SPS) voltage and current and will set flags when those limits
28598  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
28599  supply off if either of those flags are set.
28600  Precondition:
28601  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28602  should be called before calling this.
28603  Parameters:
28604  None.
28605  Returns:
28606  None.
28607  Remarks:
28608  This routine must be called from the APP_Tasks() routine.
28609  Example:
28610  WL_SPS_Tasks()
28611  */
28612 
28613 void
28614  WL_SPS_Tasks ( void ) ;
28615  /* WL_SPS_H */
28616 /***************************************************************************************
28617  End of File
28618  */
28619 
28620 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h*/
28621 /* CLOSE_FILE Include File */
28622 
28623 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
28624 /**************************************************************************************/
28641 /**************************************************************************************/
28642 #ifndef STATUSST_H /* Guard against multiple inclusion */
28643 #define STATUSST_H
28644 /**************************************************************************************/
28645 /**************************************************************************************/
28646 /* Section: Included Files */
28647 /**************************************************************************************/
28648 /**************************************************************************************/
28649 #include <stdbool.h>
28650 #include <stdint.h>
28651 /*typedef unsigned char uchar8_t*/
28652 /**************************************************************************************/
28653 /**************************************************************************************/
28654 /* Section: Interface Functions */
28655 /**************************************************************************************/
28656 /**************************************************************************************/
28657 /*!*************************************************************************************
28658  Function:
28659  void Set_Status(uint8_t bitposn)
28660  Summary:
28661  This function sets the desired bit to a one in the PIB status register.
28662  Description:
28663  This function sets the desired bit to a one in the PIB status register. This is
28664  called by various functions to indicate a command result or switch setting.
28665 
28666  Precondition:
28667  None.
28668  Parameters:
28669  uint8_t bitposn - the desired bit position in the PIB status register.
28670  Returns
28671  None.
28672 
28673  Remarks:
28674  None.
28675 
28676  Example:
28677  Set_Status(6)
28678  */
28679 
28680 void
28681  Set_Status (
28682  uint8_t bitposn ) ;
28683 /*!*************************************************************************************
28684  Function:
28685  void Clear_Status(unsigned short bitposn)
28686  Summary:
28687  This function sets the desired bit to a zero in the PIB status register.
28688  Description:
28689  This function sets the desired bit to a zero in the PIB status register. This is
28690  called by various functions to indicate a command result or switch setting.
28691 
28692  Precondition:
28693  None.
28694  Parameters:
28695  uint8_t bitposn - the desired bit position in the PIB status register.
28696  Returns
28697  None.
28698 
28699  Remarks:
28700  None.
28701 
28702  Example:
28703  ClearStatus(7)
28704  */
28705 
28706 void
28707  Clear_Status (
28708  uint8_t bitposn ) ;
28709 /*!*************************************************************************************
28710  Function:
28711  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
28712  Summary:
28713  Function to prepare the protocol A response.
28714  Description:
28715  Function to prepare the protocol A response. The return message is seven bytes.
28716  the first byte is the command that was sent. the next two bytes are the PIB status
28717  register. The next three bytes can contain two - 12 bit data fields. The data is
28718  then transferred to the TxFifo. The CRC for the return message is calculated
28719  and placed in the last byte.
28720 
28721  Precondition:
28722  None.
28723  Parameters:
28724  uint8_t byte - The command byte.
28725  uint16_t data2 - a 12 bit data field.
28726  uint16_t data1 - 1 12 bit data field.
28727  Returns
28728  None.
28729 
28730  Remarks:
28731  None.
28732 
28733  Example:
28734  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
28735  */
28736 
28737 void
28739  uint8_t byte ,
28740  uint16_t data2 ,
28741  uint16_t data1 ) ;
28742 /*!*************************************************************************************
28743  Function:
28744  void Prepare_Return_B(uint8_t byt[] )
28745  Summary:
28746  Function to prepare the protocol B response.
28747  Description:
28748  Function to prepare the protocol B response. The return message is seven bytes.
28749  the first byte is the command that was sent. the next two bytes are the PIB status
28750  register. The next three bytes can contain a 12 bit Switch status register,
28751  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
28752  TxFifo. The CRC for the return message is calculated and placed in the last byte.
28753 
28754  Precondition:
28755  None.
28756  Parameters:
28757  uint8_t byt[] - Three received bytes from a PerfSwitch.
28758  Returns
28759  None.
28760 
28761  Remarks:
28762  None.
28763 
28764  Example:
28765  Prepare_Return_B( MAN.msg )
28766  */
28767 
28768 void
28770  uint8_t byt [] ) ;
28771  /* STATUSST_H */
28772 /***************************************************************************************
28773  End of File
28774  */
28775 
28776 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
28777 /* CLOSE_FILE Include File */
28778 
28779 /**************************************************************************************/
28780 /**************************************************************************************/
28781 /* Section: Structure Data and Local Variables */
28782 /**************************************************************************************/
28783 /**************************************************************************************/
28784 /* HV_PS Data
28785  Summary:
28786  These structures hold required data.
28787  Description:
28788  These structures hold required data. These are here to link these
28789  structures for use by the local functions.
28790 
28791  Remarks:
28792  These are defined in hvps.h
28793 */
28794 
28795 HVPS_DATA
28797 
28798 static HVPS_STATES
28800 /**************************************************************************************/
28801 /**************************************************************************************/
28802 /* Section: SPI Callback Functions */
28803 /**************************************************************************************/
28804 /**************************************************************************************/
28805 
28806 static void
28808  DRV_SPI_BUFFER_EVENT event ,
28809  DRV_SPI_BUFFER_HANDLE bufferHandle ,
28810  void * context )
28811  {
28812  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28813  if
28814  (
28816  )
28817  {
28818  ((int)(bitmapstruct.element1 |= (1 << 29))); /* 1 */
28819  {
28821  }
28822  } else ((int)(bitmapstruct.element1 |= (1 << 30))); /* 4 */
28823  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 30 */
28824  hvps_61zqendz ( 64 ) ; /* 30 */
28825  }
28826 /**************************************************************************************/
28827 /**************************************************************************************/
28828 /* Section: Interface Functions */
28829 /**************************************************************************************/
28830 /**************************************************************************************/
28831 
28832 void
28834  uint16_t value )
28835  {
28836  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 0))); /* 37 */
28837  if
28838  (
28839  value > 0U
28840  ) /* Ensure the denominator is not zero,(MISRA)*/
28841  {
28842  ((int)(bitmapstruct.element2 |= (1 << 1))); /* 1 */
28843  {
28845  value ; /* Find time in seconds needed for HVPS to go from 0 to 500 VDC.*/
28846  }
28847  } else ((int)(bitmapstruct.element2 |= (1 << 2))); /* 4 */
28848  HV_PS.rate_time = HV_PS.rate_time * 1000U ;/* Convert to milliseconds.*/
28850  255U ; /* Find update rate based on 255 DAC counts for 500 VDC HVPS output.*/
28851  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 30 */
28852  hvps_61zqendz ( 68 ) ; /* 30 */
28853  }
28854 /**************************************************************************************/
28855 /**************************************************************************************/
28856 /* Section: State Machine Functions */
28857 /**************************************************************************************/
28858 /**************************************************************************************/
28859 /***************************************************************************************
28860  Function:
28861  void HVPS_Tasks ( void )
28862  Summary:
28863  This routine is the HVPS_tasks function. It defines the (HV_PS) state machine and
28864  core logic.
28865  Remarks:
28866  Refer to the hvps.h interface header for function usage details.
28867  */
28868 
28869 void
28870  HVPS_Tasks ( void )
28871  {
28872  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 4))); /* 37 */
28873  switch (
28874  ( ( int )( /* 29 */
28875  HV_PS.state
28876  ))*
28877  ((bitmapstruct.element2 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ) /* 19 */
28878  )
28879  {
28880  case HVPS_STATE_INIT :
28881  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
28882  /* Initialize values.*/
28883  {
28884  HV_PS.new_cont_values_flag = false ; /* New ADC control pot values are not available.*/
28885  HV_PS.cont_prev = 0U ; /* The previous control voltage count.*/
28886  HV_PS.cont_new = 0U ; /* The new control voltage count.*/
28887  HV_PS.pos_dir = true ; /* Set true if the new count is greater than the previous count.*/
28888  HV_PS.count = 0U ; /* The difference between the new and previous counts.*/
28889  HV_PS.tick = false ; /* Timer tick used to regulate when the control DAC is updated.*/
28890  HV_PS.drvSPIHandle = (
28891  (
28892  ( DRV_HANDLE ) - 1 ) ) ; /* Set the HV_PS SPI Port handle to invalid.*/
28893  HV_PS.spi_write_complete_flag = false ; /* Set to false when the SPI operation is not complete.*/
28894  HV_PS.spi_sent_flag = false ;
28895  HV_PS.shutdown = false ; /* Set to true if the HVPS shuts down.*/
28896  HV_PS.state = HVPS_SENSOR_OFFSET ; /* Move on to open the SPI port.*/
28897  HV_PS.update_rate = 20U ; /* DAC control voltage incremented every 20mS.*/
28898  HV_PS.update_count = 0U ; /* Initialize update counter.*/
28899  HV_PS.update_flag = false ; /* Initialize flag to update control DAC.*/
28900  HV_PS.sensor_constant = ( uint16_t ) (
28901  ( 3.3F /
28902  4096.0F ) * ( 1.3243F /
28903  0.066F ) /* Convert ADC reading to mA current. Convert to integer causes @ 1% error.(16).*/
28904  * 1000.0F * .650F ) ; /* 1.3243 is circuit gain. 0.066 is hall effect IC sensitivity. .650 is empirical correction.*/
28905  HV_PS.current_limit = 60 ; /* Set the initial current limit to 60mA.*/
28906  HV_PS.max_current = 0U ;
28907  HV_PS.offset = 0U ;
28908  }
28909  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 16 */
28910  goto l128946 ;
28911  case HVPS_SENSOR_OFFSET :
28912  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
28913  {
28914  if
28915  (
28917  ) /* If a new value is available,*/
28918  {
28919  ((int)(bitmapstruct.element2 |= (1 << 9))); /* 1 */
28920  {
28921  HV_PS.sensor_offset = ADC.hvps_i ; /* First reading is the zero current sensor offset.*/
28922  HV_PS.state = HVPS_STATE_INIT_SPI ; /* Move on to read the WL_SPS current.*/
28923  HV_PS.new_current_values_flag = false ; /* Reset the new current value flag.*/
28924  }
28925  } else ((int)(bitmapstruct.element2 |= (1 << 10))); /* 4 */
28926  }
28927  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 16 */
28928  goto l128946 ;
28929  case HVPS_STATE_INIT_SPI :
28930  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ); /* 41 */
28931  /* Open the SPI port.*/
28932  {
28933  if
28934  (
28935  HV_PS.drvSPIHandle == (
28936  (
28937  ( DRV_HANDLE ) - 1 ) )
28938  )
28939  {
28940  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 1 */
28941  {
28942  HV_PS.drvSPIHandle = DRV_SPI_Open ( 2 , /* Open SPI port for HVPS Control DAC.*/
28944  }
28945  } else ((int)(bitmapstruct.element2 |= (1 << 14))); /* 4 */
28946  if
28947  (
28948  HV_PS.drvSPIHandle != (
28949  (
28950  ( DRV_HANDLE ) - 1 ) )
28951  ) /* If the SPI port for the HV_PS control DAC has been opened,*/
28952  {
28953  ((int)(bitmapstruct.element2 |= (1 << 15))); /* 1 */
28954  {
28955  HV_PS.state = HVPS_STATE_SHUTDOWN_CHECK ; /* Move on to check for a shutdown event.*/
28956  }
28957  } else ((int)(bitmapstruct.element2 |= (1 << 16))); /* 4 */
28958  }
28959  ((int)(bitmapstruct.element2 |= (1 << 17))); /* 16 */
28960  goto l128946 ;
28962  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 18) : 0)), 1 ); /* 41 */
28963  {
28964  if
28965  ( /* 50 */
28966  (
28967 
28968  ( /* 51 */
28969  (
28970  HV_PS.shutdown == true
28971  )
28972  ? (bitmapstruct.element2 |= (1 << 20 ), 1)
28973  : (bitmapstruct.element2 |= (1 << 19 ), 0) ) /* 54 */
28974  ||
28975 
28976  ( /* 51 */
28977  (
28978  WL_SPS.overcurrent_flag == true
28979  )
28980  ? (bitmapstruct.element2 |= (1 << 22 ), 1)
28981  : (bitmapstruct.element2 |= (1 << 21 ), 0) ) /* 54 */
28982  ||
28983  ( WL_SPS.overvoltage_flag == true )
28984  ) /* or if we have an over voltage or over current condition,*/
28985  ) /* 1 */
28986  {
28987  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 1 */
28988  {
28989  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 ) ;/* Turn the HVPS off.*/
28990  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 ) ;/* Turn the DUMP_FIRE_LED on to indicate an issue with the HVPS supply.*/
28991  HV_PS.cont_prev = 0U ; /* Set the control count to 0.*/
28992  HV_PS.count = 0U ; /* Reset count between previous and new values.*/
28993  HV_PS.state = HVPS_STATE_SEND_CONT_V ; /* Move on to send that count to the HVPS control DAC.*/
28994  if
28995  (
28996  HV_PS.pot_switch == false
28997  ) /* If during shutdown the HVPS control pot is turned off,*/
28998  {
28999  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 1 */
29000  {
29001  HV_PS.shutdown = false ; /* Reset the flags.*/
29002  WL_SPS.overcurrent_flag = false ;
29003  WL_SPS.overvoltage_flag = false ;
29004  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 ) ;/* Turn the DUMP_FIRE_LED off.*/
29005  Clear_Status ( 3 ) ;/* Clear status bit 2 to clear the overvoltage bit.*/
29006  }
29007  } else ((int)(bitmapstruct.element2 |= (1 << 25))); /* 4 */
29008  }
29009  ((int)(bitmapstruct.element2 |= (1 << 26))); /* 3 */
29010  }
29011  else /* Otherwise,*/
29012  {
29013  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 2 */
29014  {
29015  HV_PS.state = HVPS_STATE_READ_SWITCH ; /* move onto read the control pot switch.*/
29016  }
29017  }
29018  }
29019  ((int)(bitmapstruct.element2 |= (1 << 28))); /* 16 */
29020  goto l128946 ;
29021  case HVPS_STATE_READ_SWITCH :
29022  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ); /* 41 */
29023  {
29024  if
29025  (
29026  HV_PS.pot_switch == true
29027  ) /* If the HVPS control pot has been turned on,*/
29028  {
29029  ((int)(bitmapstruct.element2 |= (1 << 30))); /* 1 */
29030  {
29031  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 ) ;/* Turn the HVPS on.*/
29032  HV_PS.state = HVPS_STATE_READ_CONT_V ; /* move on to read the control voltage from the pot.*/
29033  }
29034  ((int)(bitmapstruct.element2 |= (1 << 31))); /* 3 */
29035  }
29036  else /* Otherwise,*/
29037  {
29038  ((int)(bitmapstruct.element3 |= (1 << 0))); /* 2 */
29039  {
29040  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 ) ;/* Turn the HVPS off.*/
29041  HV_PS.cont_prev = 0U ; /* Set the control count to 0.*/
29042  HV_PS.count = 0U ; /* Reset count between previous and new values.*/
29043  HV_PS.state = HVPS_STATE_SEND_CONT_V ; /* Move on to send that count to the HVPS control DAC.*/
29044  Clear_Status ( 5 ) ;/* Positive voltage not detected.*/
29045  Clear_Status ( 6 ) ;/* Negative voltage not detected.*/
29046  }
29047  }
29048  }
29049  ((int)(bitmapstruct.element3 |= (1 << 1))); /* 16 */
29050  goto l128946 ;
29051  case HVPS_STATE_READ_CONT_V :
29052  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 2) : 0)), 1 ); /* 41 */
29053  /* Read the control voltage from the pot.*/
29054  {
29055  if
29056  (
29057  HV_PS.new_cont_values_flag == true
29058  ) /* If we have a new value from the ADC,*/
29059  {
29060  ((int)(bitmapstruct.element3 |= (1 << 3))); /* 1 */
29061  {
29062  HV_PS.cont_in = ADC.hvps_cont ; /* retrieve the value and*/
29063  HV_PS.new_cont_values_flag = false ; /* reset the flag.*/
29064  HV_PS.state = HVPS_STATE_CALC_SETTING ; /* Move on to calculate the DAC value.*/
29065  }
29066  } else ((int)(bitmapstruct.element3 |= (1 << 4))); /* 4 */
29067  }
29068  ((int)(bitmapstruct.element3 |= (1 << 5))); /* 16 */
29069  goto l128946 ;
29071  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
29072  {
29073  HV_PS.cont_new = HV_PS.cont_in >> 4 ; /* Convert the 12-bit ADC reading to an 8-bit value.*/
29074  if
29075  (
29077  ) /* If the new control value is greater than the previous value,*/
29078  {
29079  ((int)(bitmapstruct.element3 |= (1 << 7))); /* 1 */
29080  {
29081  HV_PS.count = HV_PS.cont_new - HV_PS.cont_prev ; /* calculate the number of counts between the two values.*/
29082  HV_PS.pos_dir = true ; /* Set to true because the new pot value is greater than the previous.*/
29083  HV_PS.state = HVPS_STATE_ADJUST_CONT_V ; /* Move on to send the new value to the HV_PS control DAC.*/
29084  }
29085  ((int)(bitmapstruct.element3 |= (1 << 8))); /* 3 */
29086  }
29087  else
29088  {
29089  ((int)(bitmapstruct.element3 |= (1 << 9))); /* 2 */
29090  {
29091  if
29092  (
29094  ) /* If the new control value is less than the previous value,*/
29095  {
29096  ((int)(bitmapstruct.element3 |= (1 << 10))); /* 1 */
29097  {
29098  HV_PS.count = HV_PS.cont_prev - HV_PS.cont_new ;/* calculate the number of counts between the two values.*/
29099  HV_PS.pos_dir = false ;/* Set to false because the new pot value is less than the previous.*/
29100  HV_PS.state = HVPS_STATE_ADJUST_CONT_V ;/* Move on to send the new value to the HV_PS control DAC.*/
29101  }
29102  ((int)(bitmapstruct.element3 |= (1 << 11))); /* 3 */
29103  }
29104  else
29105  {
29106  ((int)(bitmapstruct.element3 |= (1 << 12))); /* 2 */
29107  {
29108  HV_PS.state = HVPS_STATE_READ_SWITCH ;/* There was no change. Go monitor the switch.*/
29109  }
29110  }
29111  }
29112  }
29113  }
29114  ((int)(bitmapstruct.element3 |= (1 << 13))); /* 16 */
29115  goto l128946 ;
29117  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 14) : 0)), 1 ); /* 41 */
29118  {
29119  if
29120  ( /* 50 */
29121  (
29122 
29123  ( /* 52 */
29124  (
29125  HV_PS.pos_dir == true
29126  )
29127  ? (bitmapstruct.element3 |= (1 << 15 ), 1)
29128  : (bitmapstruct.element3 |= (1 << 16 ), 0) ) /* 54 */
29129  &&
29130  ( HV_PS.count > 0U )
29131  ) /* If we are not through increasing the voltage,*/
29132  ) /* 1 */
29133  {
29134  ((int)(bitmapstruct.element3 |= (1 << 17))); /* 1 */
29135  {
29136  HV_PS.cont_prev = HV_PS.cont_prev + 1U ; /* Increment the previous control voltage value.*/
29137  HV_PS.count = HV_PS.count - 1U ; /* Decrement the difference count.*/
29138  }
29139  ((int)(bitmapstruct.element3 |= (1 << 18))); /* 3 */
29140  }
29141  else
29142  {
29143  ((int)(bitmapstruct.element3 |= (1 << 19))); /* 2 */
29144  {
29145  if
29146  ( /* 50 */
29147  (
29148 
29149  ( /* 52 */
29150  (
29151  HV_PS.pos_dir == false
29152  )
29153  ? (bitmapstruct.element3 |= (1 << 20 ), 1)
29154  : (bitmapstruct.element3 |= (1 << 21 ), 0) ) /* 54 */
29155  &&
29156  ( HV_PS.count > 0U )
29157  ) /* If we are not through decreasing the voltage,*/
29158  ) /* 1 */
29159  {
29160  ((int)(bitmapstruct.element3 |= (1 << 22))); /* 1 */
29161  {
29162  HV_PS.cont_prev = HV_PS.cont_prev - 1U ;/* Decrement the previous control voltage value.*/
29163  HV_PS.count = HV_PS.count - 1U ;/* Decrement the difference count.*/
29164  }
29165  ((int)(bitmapstruct.element3 |= (1 << 23))); /* 3 */
29166  }
29167  else
29168  {
29169  ((int)(bitmapstruct.element3 |= (1 << 24))); /* 2 */
29170  {
29171  /*Comment.*/
29172  }
29173  }
29174  }
29175  }
29177  }
29178  ((int)(bitmapstruct.element3 |= (1 << 25))); /* 16 */
29179  goto l128946 ;
29180  case HVPS_STATE_SEND_CONT_V :
29181  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 26) : 0)), 1 ); /* 41 */
29182  /* This updates the DAC at a fixed rate set by the HV_PS.update_rate.*/
29183  {
29184  if
29185  ( /* 50 */
29186  (
29187 
29188  ( /* 52 */
29189  (
29191  )
29192  ? (bitmapstruct.element3 |= (1 << 27 ), 1)
29193  : (bitmapstruct.element3 |= (1 << 28 ), 0) ) /* 54 */
29194  &&
29195  ( HV_PS.tick == true )
29196  ) /* If we have not counted to the update rate and we got a timer tick,*/
29197  ) /* 1 */
29198  {
29199  ((int)(bitmapstruct.element3 |= (1 << 29))); /* 1 */
29200  {
29201  HV_PS.tick = false ; /* Reset the Timer 1 tick*/
29202  HV_PS.update_count ++ ; /* and update the counter.*/
29203  }
29204  } else ((int)(bitmapstruct.element3 |= (1 << 30))); /* 4 */
29205  if
29206  (
29208  ) /* If we have counter to the update rate,*/
29209  {
29210  ((int)(bitmapstruct.element3 |= (1 << 31))); /* 1 */
29211  {
29212  HV_PS.update_count = 0U ; /* reset the counter and*/
29213  HV_PS.update_flag = true ; /* set the flag so we can update the DAC.*/
29214  }
29215  } else ((int)(bitmapstruct.element4 |= (1 << 0))); /* 4 */
29216  if
29217  ( /* 50 */
29218  (
29219 
29220  ( /* 52 */
29221  (
29222  HV_PS.update_flag == true
29223  )
29224  ? (bitmapstruct.element4 |= (1 << 1 ), 1)
29225  : (bitmapstruct.element4 |= (1 << 2 ), 0) ) /* 54 */
29226  &&
29227  ( HV_PS.spi_sent_flag == false )
29228  ) /* If the update flag is true and we have not sent a value to the HV_PS DAC,*/
29229  ) /* 1 */
29230  {
29231  ((int)(bitmapstruct.element4 |= (1 << 3))); /* 1 */
29232  {
29233  HV_PS.adj[ 0 ] = MAN_BIAS.dac_b_setting | ( HV_PS.cont_prev & 0x00FFU ) ;/* Configure the SPI data to write to the DAC B only.*/
29236 //
29237 // HV_PS.bufferHandle = DRV_SPI_BufferAddWrite2(HV_PS.drvSPIHandle, /* write the control setting to the HV_PS control DAC.*/
29238 // &HV_PS.ADJ, sizeof(HV_PS.ADJ), SPI_4_EventHandler, NULL,
29239 // &HV_PS.bufferHandle2 );
29240  HV_PS.spi_sent_flag = true ; /* Set this flag to show we sent data to the HV_PS DAC SPI port.*/
29241  HV_PS.update_flag = false ; /* Reset the flag.*/
29242  }
29243  } else ((int)(bitmapstruct.element4 |= (1 << 4))); /* 4 */
29244  if
29245  (
29247  ) /* If the SPI port is through sending data,*/
29248  {
29249  ((int)(bitmapstruct.element4 |= (1 << 5))); /* 1 */
29250  {
29251  HV_PS.spi_write_complete_flag = false ; /* reset the flag.*/
29252  HV_PS.spi_sent_flag = false ; /* Reset the flag so we can send data.*/
29253  if
29254  (
29255  HV_PS.count == 0U
29256  ) /* If we have gone through all of the counts,*/
29257  {
29258  ((int)(bitmapstruct.element4 |= (1 << 6))); /* 1 */
29259  {
29260  HV_PS.cont_prev = HV_PS.cont_new ; /* Ensure the previous value equals the new value.*/
29261  HV_PS.state = HVPS_STATE_SHUTDOWN_CHECK ; /* Move on to check for a shutdown.*/
29262  }
29263  ((int)(bitmapstruct.element4 |= (1 << 7))); /* 3 */
29264  }
29265  else /* Otherwise,*/
29266  {
29267  ((int)(bitmapstruct.element4 |= (1 << 8))); /* 2 */
29268  {
29269  HV_PS.state = HVPS_STATE_ADJUST_CONT_V ; /* keep adjusting the control voltage.*/
29270  }
29271  }
29272  }
29273  } else ((int)(bitmapstruct.element4 |= (1 << 9))); /* 4 */
29274  }
29275  ((int)(bitmapstruct.element4 |= (1 << 10))); /* 16 */
29276  goto l128946 ;
29278  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 11) : 0)), 1 ); /* 41 */
29279  {
29280  if
29281  (
29283  ) /* If a new value is available, check*/
29284  {
29285  ((int)(bitmapstruct.element4 |= (1 << 12))); /* 1 */
29286  {
29287  if
29288  (
29290  ) /* if the ADC reading is greater than the zero current offset reading,*/
29291  {
29292  ((int)(bitmapstruct.element4 |= (1 << 13))); /* 1 */
29293  {
29294  HV_PS.current = ADC.hvps_i - HV_PS.sensor_offset ; /* Determine the counts for a positive current.*/
29295  }
29296  ((int)(bitmapstruct.element4 |= (1 << 14))); /* 3 */
29297  }
29298  else /* Otherwise,*/
29299  {
29300  ((int)(bitmapstruct.element4 |= (1 << 15))); /* 2 */
29301  {
29302  HV_PS.current = HV_PS.sensor_offset - ADC.hvps_i ; /* determine the counts for a negative current.*/
29303  }
29304  }
29305  HV_PS.current = HV_PS.current - HV_PS.offset ; /* Add the offset to the current reading.*/
29306  HV_PS.current = HV_PS.current * HV_PS.sensor_constant ; /* Convert ADC counts to mA. The current is an absolute value. No polarity indication.*/
29307  if
29308  (
29310  ) /* Check for a maximum current reading.*/
29311  {
29312  ((int)(bitmapstruct.element4 |= (1 << 16))); /* 1 */
29313  {
29315  }
29316  } else ((int)(bitmapstruct.element4 |= (1 << 17))); /* 4 */
29317  HV_PS.new_current_values_flag = false ; /* Reset the new current value flag.*/
29318  HV_PS.state = HVPS_STATE_CHECK_OVERCURRENT ; /* Move on to the overcurrent check.*/
29319  }
29320  } else ((int)(bitmapstruct.element4 |= (1 << 18))); /* 4 */
29321  }
29322  ((int)(bitmapstruct.element4 |= (1 << 19))); /* 16 */
29323  goto l128946 ;
29325  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 20) : 0)), 1 ); /* 41 */
29326  {
29327  if
29328  (
29330  ) /* HV_PS Current has exceeded current limit,*/
29331  {
29332  ((int)(bitmapstruct.element4 |= (1 << 21))); /* 1 */
29333  {
29334  HV_PS.over_current_count ++ ; /* Increment occurrence count.*/
29335  if
29336  (
29338  ) /* If it exceeds limit 5 times in a row,*/
29339  {
29340  ((int)(bitmapstruct.element4 |= (1 << 22))); /* 1 */
29341  {
29342  HV_PS.overcurrent_flag = true ;
29343  }
29344  } else ((int)(bitmapstruct.element4 |= (1 << 23))); /* 4 */
29345  }
29346  ((int)(bitmapstruct.element4 |= (1 << 24))); /* 3 */
29347  }
29348  else
29349  {
29350  ((int)(bitmapstruct.element4 |= (1 << 25))); /* 2 */
29351  {
29352  HV_PS.overcurrent_flag = false ; /* Reset flag.*/
29353  HV_PS.over_current_count = 0U ; /* Reset Count.*/
29354  }
29355  }
29356  HV_PS.state = HVPS_STATE_READ_VOLTAGE ; /* Go read the wire-line voltage.*/
29357  }
29358  ((int)(bitmapstruct.element4 |= (1 << 26))); /* 16 */
29359  goto l128946 ;
29361  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 27) : 0)), 1 ); /* 41 */
29362  {
29363  HV_PS.state = HVPS_STATE_SHUTDOWN_CHECK ; /* Move on to check for a shutdown event.*/
29364  }
29365  ((int)(bitmapstruct.element4 |= (1 << 28))); /* 16 */
29366  goto l128946 ;
29367  default :
29368  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ); /* 41 */
29369  {
29370  }
29371  ((int)(bitmapstruct.element4 |= (1 << 30))); /* 16 */
29372  goto l128946 ;
29373  }
29374 l128946 :
29375  ; /* 18 */
29376  ((int)(bitmapstruct.element4 |= (1 << 31))); /* 30 */
29377  hvps_61zqendz ( 160 ) ; /* 30 */
29378  }
29379 /***************************************************************************************
29380  End of File
29381  */
29382 #define qqqbranches 160
29383 #define QQQMAXMCDCSIZE 2
29384 /********************** LDRA_PORT INSTRUMENTATION **********************/
29385 
29386 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
29387 #define ldra_sscanf
29388  /* put in undefs to protect our parameter names from macros */
29389 #undef f
29390 #undef i
29391 #undef j
29392 #undef k
29393 #undef s
29394 #undef l
29395 #undef ii
29396 #undef some
29397 #undef none
29398 #undef from
29399 #undef a
29400 #undef b
29401 #undef iz
29402 #undef jz
29403 #undef qqnull_params
29404 #define qqnull_params void
29405  /* Conventional Instrumentation */
29406 #define qqzzidfield 1
29407  /* single file or fileid */
29408  /* these have an extra field for the fileid */
29409  static char qqqqone[] = "%6d\n"; /* single point */
29410  /* uncompressed data structures */
29411  /* uncompressed bitmap */
29412 #define QQQFIXEDSIZE
29413  static int qqqlast = 0;
29414  extern int qqupload_registered;
29415  extern int hvps_61zqqzqz(qqnull_params);
29416  extern int hvps_61zqqzqz1(qqnull_params);
29417  /* ----------------------------------------------------------------------* 200 *
29418  * Procedures
29419  * -----------------------------------------------------------------------------
29420  */
29421  /* ----------- zscanf ---------------------------------------------------* 201 *
29422  * Returns an integer extracted from a string
29423  * -----------------------------------------------------------------------------
29424  */
29425  static int hvps_61zscanf(char * qqscan_str)
29426  {
29427  int qqvalue;
29428  int qqisign;
29429  char * qqcptr;
29430  qqvalue = 0;
29431  qqisign = 1;
29432  qqcptr = qqscan_str;
29433  /* Skip spaces */
29434  while (qqcptr[0] == ' ')
29435  {
29436  qqcptr++;
29437  }
29438  /* Check for a leading ---
29439  */
29440  if (qqcptr[0] == '-')
29441  {
29442  qqisign = -1;
29443  qqcptr++;
29444  }
29445  /* Extract digits */
29446  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
29447  {
29448  qqvalue = 10 * qqvalue;
29449  qqvalue = qqvalue + (qqcptr[0] - '0');
29450  qqcptr++;
29451  }
29452  qqvalue = qqisign * qqvalue;
29453  return qqvalue;
29454  } /* end of zscanf */
29455  /* ----------------------------------------------------------------------* 210 *
29456  * C System utilities in use:
29457  * fprintf
29458  * fclose
29459  * sscanf
29460  * -----------------------------------------------------------------------------
29461  */
29462  /* ----------------------------------------------------------------------* 213 *
29463  * qqoutput* suite
29464  * Main output routines. These may require modification.
29465  * -----------------------------------------------------------------------------
29466  */
29467  /* ----------------------------------------------------------------------* 214 *
29468  * qqoutput
29469  * This is the principle output routine.
29470  * -----------------------------------------------------------------------------
29471  */
29472  static void qqoutput(FILEPOINT char * s,int i)
29473  /* f - file pointer, s - format string, i - integer for probe value */
29474  {
29475  /* printing to a file */
29476  /* fprintf exists, not threaded */
29477  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
29478  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
29479  ldra_port_write (&ldra_buffer[0]);
29480  } /* end of qqoutput */
29481  /* ----------------------------------------------------------------------* 215 *
29482  * qqoutput0
29483  * -----------------------------------------------------------------------------
29484  */
29485  static void qqoutput0(FILEPOINT char * s)
29486  {
29487  ldra_port_write(s);
29488  } /* end of qqoutput0 */
29489  /* ----------------------------------------------------------------------* 216 *
29490  * qqoutput2
29491  * -----------------------------------------------------------------------------
29492  */
29493  static void qqoutput2(FILEPOINT char * s,int i, int j)
29494  {
29495  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
29496  ldra_port_write (&ldra_buffer[0]);
29497  } /* end of qqoutput2 */
29498  /* ----------------------------------------------------------------------* 217 *
29499  * qqoutput3
29500  * -----------------------------------------------------------------------------
29501  */
29502  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
29503  {
29504  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
29505  ldra_port_write (&ldra_buffer[0]);
29506  } /* end of qqoutput3 */
29507  /* ----------------------------------------------------------------------* 218 *
29508  * qqoutput4
29509  * -----------------------------------------------------------------------------
29510  */
29511  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
29512  {
29513  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
29514  ldra_port_write (&ldra_buffer[0]);
29515  } /* end of qqoutput4 */
29516  /* ----------------------------------------------------------------------* 219 *
29517  * end of qqoutput* suite
29518  * -----------------------------------------------------------------------------
29519  */
29520  /* ----------------------------------------------------------------------* 222 *
29521  * qqqqinitialise
29522  * This procedure initialises the structures for
29523  * compressed execution histories.
29524  * -----------------------------------------------------------------------------
29525  */
29526  static void qqqqinitialise(int ii)
29527  {
29528  unsigned int i;
29529  /* First time through. */
29530  /* bitmap */
29531  /* bitmap separate */
29532  qqqlast = 1; /* stops qqfun() calling initialise again */
29533  /* bitmap */
29534  /* bitmap singlefile */
29535  /* struct singlefile notmainfl */
29536  } /* end of qqqqinitialise */
29537 /* ----------------------------------------------------------------------* 225 *
29538 * qqqbitmapreset
29539 * This procedure resets the structures for
29540 * compressed execution histories.
29541 * -----------------------------------------------------------------------------
29542 */
29543 static void qqqbitmapreset()
29544 {
29545 struct bitmapstruct_t localbitmap = {0};
29546 bitmapstruct = localbitmap;
29547 } /* end of qqqbitmapreset */
29548 #undef QQQTEMP1
29549 #define QQQTEMP1
29550  /* ----------- zqqzqz ---------------------------------------------------* 310 *
29551  * -----------------------------------------------------------------------------
29552  */
29553  /* ----------------------------------------------------------------------* 312 *
29554  * This routine opens the execution history file. It is instrumented at the
29555  * start of the main program if one exists in the file. In general this is
29556  * superceded by hvps_61zqqzqz1 below.
29557  * -----------------------------------------------------------------------------
29558  */
29560  {
29561  if ( hvps_61zzopen != 1 )
29562  {
29563 #undef QQQMUSTOPEN
29564  hvps_61zzopen = 1;
29565  }
29566  return(1);
29567  } /* end of zqqzqz */
29568  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
29569  * -----------------------------------------------------------------------------
29570  */
29571  /* ----------------------------------------------------------------------* 317 *
29572  * This routine also opens the execution history file. It is called
29573  * automatically if a probe fires and the execution history is not already
29574  * opened (hvps_61zzopen = 0 ).
29575  * Because this always works ( it was intended for files with no main program
29576  * it is now the de facto common way to open the execution history.
29577  * -----------------------------------------------------------------------------
29578  */
29580  {
29581  if ( hvps_61zzopen != 1 )
29582  {
29583  ldra_port_open(); /* 7 */
29584  qqqqinitialise(0);
29585  hvps_61zzopen = 1;
29586  }
29587  return(1);
29588  } /* end of zqqzqz1 */
29589  /* ----------- zqendz ---------------------------------------------------* 330 *
29590  * This routine is called on exiting a routine in a
29591  * module. It closes the execution history.
29592  * -----------------------------------------------------------------------------
29593  */
29594 static int hvps_61zqendz(int qqqi)
29595  {
29596  if (!qqqstructzzopen)
29597  {
29599  qqqstructzzopen = 1;
29600  }
29601  if ( hvps_61zzopen != 1 )
29602  {
29603  hvps_61zqqzqz1();
29604  }
29605  /* ----------------------------------------------------------------------* 331 *
29606  * this is the one which puts an integer into
29607  * the execution history file and returns unity.
29608  * The format of each field consists of six columns,
29609  * the number is right justified in this field.
29610  * -----------------------------------------------------------------------------
29611  */
29612  if ( hvps_61zzopen )
29613  {
29614  /* uncompressed */
29615  /* uncompressed unbuffered */
29616  /* uncompressed unbuffered bitmap */
29617  if ( qqqi > 0 )
29618  {
29619  }
29620  else
29621  {
29622  }
29623  }
29624  qqqlast = 0;
29625  return(1);
29626  } /* end of zqendz */
29627  /* ----------------------------------------------------------------------* 335 *
29628  * Output structure - qqbmsoutput
29629  * -----------------------------------------------------------------------------
29630  */
29631  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
29632  {
29633  static int branches_printed = 0;
29634  int b, last = 0;
29635  for(b=0;b<qqqqbmselwidth/8;b++)
29636  {
29637  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
29638  ldra_port_write (&ldra_buffer[0]);
29639  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
29640  ldra_port_write (&ldra_buffer[0]);
29641  last += 8;
29642  branches_printed += 8;
29643  if (branches_printed >= qqqbranches)
29644  {
29645  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
29646  break;
29647  }
29648  }
29649  }
29650  /* ----------------------------------------------------------------------* 336 *
29651  * qqqupload
29652  * This routine loops through the stored bitmap and
29653  * outputs it. It then uploads the stored mcdc.
29654  * -----------------------------------------------------------------------------
29655  */
29656  static void qqqupload(qqnull_params)
29657  {
29658  int i;
29659  /* uncompressed bitmap (!singlefile or mainfl) separate */
29660  {
29661  hvps_61zqqzqz1();
29662 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
29663 #define LASTELEMENT
29664 #include "hvps_61zbelem.def"
29665 #undef LASTELEMENT
29666 #undef ELEMENT
29667  }
29668  /* bitmap separate */
29669  qqqlast = 1; /* stops qqfun() calling initialise again */
29670  } /* end of qqqupload */
29671  /* ----------- zqzqzq ---------------------------------------------------* 342 *
29672  * -----------------------------------------------------------------------------
29673  */
29674  /* ----------------------------------------------------------------------* 344 *
29675  * This routine should be called before the program
29676  * terminates. It closes the execution history
29677  * -----------------------------------------------------------------------------
29678  */
29679  static int hvps_61zqzqzq(int qqqi)
29680  {
29681  if ( hvps_61zzopen != 1 )
29682  {
29683  hvps_61zqqzqz1();
29684  }
29685  /* not compressed */
29686  /* do nothing for bitmap*/
29687  /* upload the history */
29688  /* bitmap */
29689  /* uncompressed bitmap */
29690  hvps_61zqendz(qqqi);
29691  /* qqqupload closes the execution history file */
29692  return(1);
29693  } /* end of zqzqzq */
29694  /* the following routines should be left alone */
29695 /* END OF TESTBED INSTRUMENTATION */
29696 
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
uint32_t DRV_TMR1_PeriodValueGet(void)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
bool DRV_USART0_TransmitBufferIsFull(void)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static int zzfileid
Definition: inszt_hvps.c:49
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
DRV_TMR_CLK_SOURCES
Definition: inszt_hvps.c:1602
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_hvps.c:13224
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
static SYS_STATUS DRV_TMR2_Status(void)
Definition: inszt_hvps.c:3841
int QQQindicator
Definition: inszt_main.c:104
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
bool DRV_SPIn_TransmitterBufferIsFull(void)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
MAN_RX_STATES
Definition: inszt_hvps.c:27957
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
uint32_t DRV_TMR3_PeriodValueGet(void)
static SYS_STATUS DRV_TMR3_Status(void)
Definition: inszt_hvps.c:3951
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
static unsigned char qqqzzglobflag
Definition: inszt_hvps.c:166
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
void DRV_ADC0_Open(void)
void DRV_TMR0_Stop(void)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
uint32_t DRV_TMR1_CounterValueGet(void)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
DRV_ADC_MODULE_ID
Definition: inszt_hvps.c:1417
static float32_t Calc_Fsk_Scaling(void)
void DRV_USART_Close(const DRV_HANDLE handle)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
static void qqoutput0(FILEPOINT char *s)
Definition: inszt_hvps.c:29485
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
bool DRV_IC0_BufferIsEmpty(void)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART0_TasksError(void)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
uint8_t DRV_PMP0_Read(void)
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
DRV_USART_BUFFER_EVENT
Definition: inszt_hvps.c:15004
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
uint16_t cont_in
Definition: hvps.h:94
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
void DRV_IC0_Stop(void)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
static void DRV_TMR0_DeInitialize(void)
Definition: inszt_hvps.c:3612
float float32_t
Definition: cf.h:50
void DRV_TMR_Close(DRV_HANDLE handle)
float float32_t
Definition: inszt_hvps.c:27926
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
#define DRV_IC_Open(drvIndex, intent)
Definition: inszt_hvps.c:1325
static void Flush_Buffer_Manchester(void)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
uint32_t SYS_DMA_ChannelCRCGet(void)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
bool DRV_TMR3_Start(void)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
void DRV_USART0_TasksReceive(void)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
void DRV_TMR0_StopInIdleEnable(void)
static void DRV_TMR1_Close(void)
Definition: inszt_hvps.c:3763
void Prepare_Return_B(uint8_t byt [])
void DRV_TMR1_Stop(void)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
Definition: hvps.h:84
void DRV_TMR3_CounterValueSet(uint32_t value)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
uint16_t count
Definition: hvps.h:101
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
uint16_t cont_prev
Definition: hvps.h:99
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
WL_SPS_STATES
Definition: inszt_app.c:28425
uint32_t DRV_TMR4_PeriodValueGet(void)
DRV_USART_BUFFER_RESULT
Definition: inszt_hvps.c:15026
uint16_t update_count
Definition: hvps.h:108
void DRV_TMR1_StopInIdleEnable(void)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool pot_switch
Definition: hvps.h:96
uint8_t DRV_USART0_ReadByte(void)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_hvps.c:13266
void DRV_ADC_Stop(void)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
static void Decode_Manchester(void)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void DRV_TMR0_CounterValueSet(uint32_t value)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool spi_write_complete_flag
Definition: hvps.h:90
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_USART0_WriteByte(const uint8_t byte)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void MAN_Tasks(void)
Definition: inszt_man.c:29645
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_TMR2_CounterClear(void)
void Clear_Status(uint8_t bitposn)
uint16_t hvps_i
Definition: adc.h:83
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
bool tick
Definition: hvps.h:98
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
bool overcurrent_flag
Definition: inszt_app.c:28468
MAN_PROCESS_STATES
Definition: inszt_app.c:29386
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
void DRV_TMR1_Initialize(void)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static int qqqisinitialised
Definition: inszt_main.c:152
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void SYS_DEBUG_Message(const char *message)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void DRV_PMP0_Write(uint8_t data)
uint16_t sensor_constant
Definition: hvps.h:115
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
void DRV_TMR4_Stop(void)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
static void qqoutput2(FILEPOINT char *s, int i, int j)
Definition: inszt_hvps.c:29493
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
Definition: inszt_hvps.c:13537
void DRV_TMR4_CounterValueSet(uint32_t value)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_hvps.c:26275
int QQQfcn_ptr_num
Definition: inszt_main.c:151
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
void DRV_TMR0_Initialize(void)
SYSTEM_OBJECTS sysObj
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
void DRV_TMR_CounterClear(DRV_HANDLE handle)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
static void DRV_TMR2_Open(void)
Definition: inszt_hvps.c:3852
DRV_USART_LINE_CONTROL
Definition: inszt_hvps.c:15223
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
SYS_DMA_ERROR
Definition: inszt_hvps.c:13399
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
Definition: inszt_hvps.c:15136
uint32_t DRV_TMR3_CounterValueGet(void)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
uint16_t sensor_offset
Definition: hvps.h:113
void DRV_TMR1_CounterValueSet(uint32_t value)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
Definition: inszt_hvps.c:3973
bool update_flag
Definition: hvps.h:109
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR_Stop(DRV_HANDLE handle)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_hvps.c:13377
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static int qqqqbmselwidth
Definition: inszt_hvps.c:48
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
uint16_t cont_new
Definition: hvps.h:100
void DRV_TMR4_CounterClear(void)
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
void DRV_TMR2_StopInIdleDisable(void)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
static void DRV_TMR1_DeInitialize(void)
Definition: inszt_hvps.c:3722
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
void DRV_ADC_Initialize(void)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
void DRV_TMR3_StopInIdleEnable(void)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
static void DRV_TMR3_DeInitialize(void)
Definition: inszt_hvps.c:3942
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
DRV_USART_TRANSFER_STATUS
Definition: inszt_hvps.c:15397
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
static int hvps_61zscanf(char *qqscan_str)
Definition: inszt_hvps.c:29425
#define QQQnumfil
Definition: inszt_hvps.c:50
static int tbrun_mode
Definition: inszt_hvps.c:96
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
Definition: inszt_hvps.c:29631
#define FILEPOINT
Definition: inszt_hvps.c:91
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
static int hvps_61zqqzqz(qqnull_params)
Definition: inszt_hvps.c:29559
static void DRV_TMR3_Close(void)
Definition: inszt_hvps.c:3983
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
static void Package_Manchester(void)
void DRV_ADC_Start(void)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_hvps.c:26155
static void DRV_TMR0_Close(void)
Definition: inszt_hvps.c:3653
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_DMA_Suspend(void)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
uint32_t baudRate
Definition: inszt_adc.c:26572
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
uint32_t DRV_TMR0_PeriodValueGet(void)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_BUFFER_EVENT
Definition: inszt_hvps.c:26307
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void APP_Tasks(void)
Definition: app.c:130
SYS_ERROR_LEVEL gblErrLvl
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t current
Definition: hvps.h:112
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
Definition: inszt_hvps.c:3863
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
void APP_Initialize(void)
Definition: app.c:93
DRV_CLIENT_STATUS
Definition: inszt_hvps.c:927
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
DRV_IO_BUFFER_TYPES
Definition: inszt_hvps.c:984
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
void DRV_ADC_DeInitialize(void)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
void PLIB_DMA_Disable(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_USART_ERROR
Definition: inszt_hvps.c:15334
void Set_WL_SPS_CurrentLimit(uint16_t value)
void DRV_TMR1_CounterClear(void)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void DRV_USART0_TasksTransmit(void)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
static void DRV_TMR0_Open(void)
Definition: inszt_hvps.c:3632
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
DRV_SPI_TASK_MODE
Definition: inszt_hvps.c:26352
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_hvps.c:1016
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
void SYS_PORTS_Initialize()
void DRV_IC0_Start(void)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
uint32_t DRV_TMR4_CounterValueGet(void)
bool DRV_TMR0_Start(void)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
Definition: inszt_hvps.c:29511
void Set_Bias(uint8_t value)
Definition: inszt_man.c:30592
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
static void qqqbitmapreset(qqnull_params)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
DRV_HANDLE drvSPIHandle
Definition: hvps.h:87
static void SPI_4_EventHandler(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_hvps.c:28807
#define qqqbranches
Definition: inszt_hvps.c:29382
bool DRV_TMR2_Start(void)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
static void DRV_TMR4_Tasks(void)
Definition: inszt_hvps.c:4133
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
static void DRV_TMR3_Tasks(void)
Definition: inszt_hvps.c:4023
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
uint16_t hvps_cont
Definition: adc.h:84
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
void Set_Status(uint8_t bitposn)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
uint16_t max_current
Definition: hvps.h:116
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_USART_INIT_FLAGS
Definition: inszt_hvps.c:15272
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
void PLIB_USART_Enable(USART_MODULE_ID index)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
static void qqqupload(qqnull_params)
Definition: inszt_hvps.c:29656
void MAN_RX_Tasks(void)
Definition: inszt_man.c:29829
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
DRV_IO_INTENT
Definition: inszt_adc.c:975
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR3_CounterClear(void)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void DRV_TMR2_Initialize(void)
bool pos_dir
Definition: hvps.h:103
void DRV_USART0_Close(void)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_hvps.c:26423
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
static char qqqqone[]
Definition: inszt_hvps.c:29409
static int qqqlast
Definition: inszt_hvps.c:29413
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void DRV_TMR4_Initialize(void)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
static void DRV_TMR1_Tasks(void)
Definition: inszt_hvps.c:3803
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
DRV_IO_INTENT
Definition: inszt_hvps.c:883
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
struct _DRV_SPI_INIT DRV_SPI_INIT
void qqqtotalupload(void)
Definition: inszt_main.c:7054
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
DRV_TMR_CLIENT_STATUS
Definition: inszt_hvps.c:1709
uint16_t adj[1]
Definition: hvps.h:93
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
static void DRV_TMR4_Open(void)
Definition: inszt_hvps.c:4072
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_hvps.c:13157
float32_t rate_time
Definition: hvps.h:107
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
DRV_USART_OPERATION_MODE
Definition: inszt_hvps.c:14967
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
MAN_STATES
Definition: inszt_app.c:29350
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_HANDLE spi_bias_fsk
Definition: inszt_app.c:29445
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
uint16_t DRV_IC0_Capture16BitDataRead(void)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void DRV_USART0_Deinitialize(void)
DRV_SPI_BUFFER_HANDLE bufferHandle2
Definition: inszt_app.c:29447
bool spi_sent_flag
Definition: hvps.h:91
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_hvps.c:14943
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
void DRV_TMR3_Initialize(void)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
void DRV_TMR3_StopInIdleDisable(void)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
void WL_SPS_Tasks(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
DRV_USART_HANDSHAKE
Definition: inszt_hvps.c:15149
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
uint16_t dac_b_setting
Definition: inszt_app.c:29450
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
Definition: inszt_hvps.c:1836
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
static int QQQfirstmcdc
Definition: inszt_hvps.c:75
ADC_STATES
Definition: adc.h:55
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
void DRV_TMR4_StopInIdleEnable(void)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
uint16_t update_rate
Definition: hvps.h:106
static void DRV_TMR4_DeInitialize(void)
Definition: inszt_hvps.c:4052
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_hvps.c:21772
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
bool overcurrent_flag
Definition: hvps.h:124
int qqupload_registered
Definition: inszt_main.c:6760
SYS_PORTS_PIN_DIRECTION
Definition: inszt_hvps.c:21796
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
void Set_HVPS_Ramp_Rate(uint16_t value)
Definition: inszt_hvps.c:28833
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_hvps.c:13243
SYS_ERROR_LEVEL
Definition: inszt_hvps.c:17456
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool SYS_DMA_IsBusy(void)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
uint16_t current_limit
Definition: hvps.h:117
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
HVPS_DATA HV_PS
Definition: inszt_hvps.c:28796
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
uint32_t DRV_TMR2_CounterValueGet(void)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
static void DRV_TMR2_Close(void)
Definition: inszt_hvps.c:3873
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR0_StopInIdleDisable(void)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
static void Test_Manchester(void)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_hvps.c:21811
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
WL_SPS_DATA WL_SPS
Definition: wl_sps.c:59
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
#define DRV_IC_Close(handle)
Definition: inszt_hvps.c:1326
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_SIDL
Definition: inszt_hvps.c:13183
DRV_USART_ERROR
Definition: inszt_adc.c:15426
uint16_t upper_voltage_limit
Definition: inszt_app.c:28454
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
HVPS_STATES
Definition: hvps.h:54
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
bool new_current_values_flag
Definition: hvps.h:122
uint8_t queueSize
Definition: inszt_adc.c:26592
WL_SPS_STATES
Definition: inszt_hvps.c:28463
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
int qqqshell_upload
Definition: inszt_main.c:150
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
SYS_DMA_DATA_WIDTH
Definition: inszt_hvps.c:13430
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
void DRV_TMR2_Stop(void)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
void Calc_Auto_Bias(void)
Definition: inszt_man.c:30558
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void DRV_TMR0_PeriodValueSet(uint32_t value)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR4_PeriodValueSet(uint32_t value)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
static bool Check_Manchester(void)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
void DRV_TMR0_CounterClear(void)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
uint16_t PORTS_DATA_MASK
Definition: inszt_hvps.c:18427
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
Definition: inszt_hvps.c:4083
void DRV_TMR1_StopInIdleDisable(void)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
Definition: inszt_hvps.c:15104
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
static void Init_Manchester(void)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
void SET_WL_SPS_IOffset(uint8_t mode)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
void DRV_IC_Stop(DRV_HANDLE handle)
static int hvps_61zqendz(int qqqi)
Definition: inszt_hvps.c:29594
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
MAN_STATES
Definition: inszt_hvps.c:27937
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
#define hvps_61zqqzqz1
Definition: inszt_hvps.c:78
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
Definition: inszt_hvps.c:3753
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void(* ldra_void_function)()
Definition: inszt_hvps.c:114
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_hvps.c:15174
static SYS_STATUS DRV_TMR0_Status(void)
Definition: inszt_hvps.c:3621
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
uint32_t DRV_IC0_Capture32BitDataRead(void)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
void DRV_ADC1_Close(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
bool new_cont_values_flag
Definition: hvps.h:97
DRV_USART_CLIENT_STATUS
Definition: inszt_hvps.c:15372
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_PMP0_ModeConfig(void)
void DRV_TMR1_PeriodValueSet(uint32_t value)
APP_DATA APP
Definition: app.c:73
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_CHANNEL_CHAIN_PRIO
Definition: inszt_hvps.c:13203
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
static void DRV_TMR4_Close(void)
Definition: inszt_hvps.c:4093
DRV_SPI_BUFFER_TYPE
Definition: inszt_hvps.c:26252
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
Definition: inszt_hvps.c:3643
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
static SYS_STATUS DRV_TMR4_Status(void)
Definition: inszt_hvps.c:4061
void DRV_TMR3_PeriodValueSet(uint32_t value)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
static void DRV_TMR1_Open(void)
Definition: inszt_hvps.c:3742
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
void ADC_Tasks(void)
Definition: adc.c:75
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static SYS_STATUS DRV_TMR1_Status(void)
Definition: inszt_hvps.c:3731
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_hvps.c:13289
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
void DRV_TMR4_StopInIdleDisable(void)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
MAN_DATA MAN
Definition: man.c:67
bool overvoltage_flag
Definition: inszt_app.c:28469
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
static int hvps_61zqzqzq(int qqqi)
Definition: inszt_hvps.c:29679
uint32_t DRV_TMR3_CounterFrequencyGet(void)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR0_Tasks(void)
Definition: inszt_hvps.c:3693
static void DRV_TMR2_Tasks(void)
Definition: inszt_hvps.c:3913
void DRV_ADC0_Close(void)
static void DRV_TMR2_DeInitialize(void)
Definition: inszt_hvps.c:3832
bool DRV_SPIn_ReceiverBufferIsFull(void)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
static void qqoutput(FILEPOINT char *s, int i)
Definition: inszt_hvps.c:29472
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
HVPS_STATES state
Definition: hvps.h:86
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
Definition: app.h:59
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_hvps.c:15195
Definition: adc.h:78
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR2_CounterValueSet(uint32_t value)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DEBUG_Print(const char *format,...)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
bool DRV_TMR4_Start(void)
HVPS_STATES
Definition: inszt_hvps.c:27616
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
bool DRV_TMR1_Start(void)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
uint8_t count
Definition: inszt_man.c:29594
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
ADC_STATES
Definition: inszt_hvps.c:27794
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
static struct bitmapstruct_t bitmapstruct
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
void DRV_PMP0_Initialize(void)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
ADC_DATA ADC
Definition: adc.c:53
MAN_RX_STATES
Definition: inszt_app.c:29370
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
static void DRV_TMR3_Open(void)
Definition: inszt_hvps.c:3962
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
void DRV_ADC1_Open(void)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_Disable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE bufferHandle
Definition: inszt_app.c:29446
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
DRV_TMR_OPERATION_MODE
Definition: inszt_hvps.c:1756
static int qqqstructzzopen
Definition: inszt_hvps.c:136
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR2_PeriodValueSet(uint32_t value)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
#define hvps_61zzopen
Definition: inszt_hvps.c:76
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
static void MAN_PROCESS_Tasks(void)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
uint32_t DRV_TMR2_PeriodValueGet(void)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
SYS_STATUS DRV_USART0_Status(void)
uint32_t DRV_TMR0_CounterValueGet(void)
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
static void qqqqinitialise(int ii)
Definition: inszt_hvps.c:29526
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
void HVPS_Tasks(void)
Definition: inszt_hvps.c:28870
static HVPS_STATES H_STATES
Definition: inszt_hvps.c:28799
uint8_t over_current_count
Definition: hvps.h:119
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
MAN_BIAS_DATA MAN_BIAS
Definition: man.c:65
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_Resume(void)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
Definition: inszt_hvps.c:29502
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
bool DRV_TMR_Start(DRV_HANDLE handle)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR2_StopInIdleEnable(void)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
void DRV_IC0_Initialize(void)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
MAN_PROCESS_STATES
Definition: inszt_hvps.c:27973
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
bool shutdown
Definition: hvps.h:105
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
void DRV_TMR3_Stop(void)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
uint32_t PORTS_DATA_TYPE
Definition: inszt_hvps.c:18440
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
uint16_t offset
Definition: hvps.h:114
DRV_SPI_MODE
Definition: inszt_hvps.c:26329
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
#define qqnull_params
Definition: inszt_hvps.c:29404
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
DRV_SPI_CLOCK_MODE
Definition: inszt_hvps.c:26207